summaryrefslogtreecommitdiffstats
path: root/sys-utils/mountpoint.c
Commit message (Collapse)AuthorAgeFilesLines
* misc: use libmnt_table reference counterKarel Zak2013-08-211-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: use libmnt_cache reference countingKarel Zak2013-08-211-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mountpoint: don't hardcode pathsKarel Zak2013-02-141-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sys-utils: verify writing to streams was successfulSami Kerola2012-04-041-0/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mountpoint: add --version & align with howto-usage-function.txtSami Kerola2012-03-301-7/+12
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mountpoint: account for error from in mnt_fs_get_targetDave Reisner2012-03-021-2/+5
| | | | | | | | | | | commit 04f087ec didn't take into consideration that mnt_fs_get_target() could return an error, and would therefore show false positives, such as: $ mkdir foo; mountpoint foo foo is a mountpoint Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* mountpoint: fix a minor bug with 0:0 devnoZhi Li2012-02-291-12/+13
| | | | | | | | | | | | | | | | | zhi@debian-lizhi:~$ mountpoint /sys /sys is not a mountpoint zhi@debian-lizhi:~$ The problem is in mountpoint.c, function dir_to_device(), which uses 0 as an error return value, but for sysfs 0 is its device number: zhi@debian-lizhi:~$ cat /proc/self/mountinfo 14 19 0:0 / /sys rw,nosuid,nodev,noexec,relatime - sysfs none rw 15 19 0:3 / /proc rw,nosuid,nodev,noexec,relatime - proc none rw My change is on dir_to_device, seperating device number from return value. Signed-off-by: Zhi Li <lizhi1215@gmail.com>
* docs: corrections to FSF license files, and postal addressSami Kerola2012-02-241-3/+3
| | | | | | | | | | | | | | The COPYING and Documentation/licenses/COPYING* files are being replaced by files from GNU web site. http://www.gnu.org/licenses/gpl-2.0.txt http://www.gnu.org/licenses/lgpl-2.1.txt Postal addresses to FSF in other files are updated to match with the address in license files. Reference: http://lists.gnu.org/archive/html/freefont-announce/2005-04/msg00001.html Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mountpoint: support symbolic and relative pathsKarel Zak2011-10-111-2/+12
| | | | | Reported-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* Revert "mountpoint: refactor exit path"Karel Zak2011-10-111-16/+10Star
| | | | | | This change is unnecessary, we can use libmount stuff for everything. This reverts commit b16b56ec55507b6b83e0d35e3cefeb16367f3363.
* mountpoint: refactor exit pathDave Reisner2011-10-111-10/+16
| | | | | | | | | | | There's only one condition for which we declare success, but many for failure. Initialize rc as failure and set to success on this single condition. In all cases, jump to a label to exit instead of exiting immediately. This will be used later on to ease cleanup of any heap allocations. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* mountpoint: fallback on stat when /proc isn't mountedKarel Zak2011-10-111-1/+23
| | | | | Reported-by: <dreisner@archlinux.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* mountpoint: return dev_t from dir_to_deviceDave Reisner2011-10-111-7/+6Star
| | | | | | | | | | | | The string returned from this function was never of much use other than to stat the path when the user requested a major:minor pair beyond the true/false exit. Save some processing and directly returning the dev_t on success, and an impossible value on failure. [kzak@redhat.com: - use 0 as dir_to_device() return value on failure] Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* mountpoint: cleanup usage()Karel Zak2011-08-161-12/+10Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: fix 'make checkincludes' warningsKarel Zak2011-07-281-2/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mountpoint: add new commandKarel Zak2011-06-211-0/+174
This is libmount based re-implementation of the mountpoint(1) command. The original implementation is maintained in sysvinit suite. The mountpoint(1) in util-linux is not enabled by default (for now) -- use --enable-mountpoint to enable the util. Signed-off-by: Karel Zak <kzak@redhat.com>