Commit graph

7 commits

Author SHA1 Message Date
Karel Zak
b031befc25 Revert "mountpoint: refactor exit path"
This change is unnecessary, we can use libmount stuff for everything.

This reverts commit b16b56ec55.
2011-10-11 11:14:31 +02:00
Dave Reisner
b16b56ec55 mountpoint: refactor exit path
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>
2011-10-11 11:03:45 +02:00
Karel Zak
dfd2c71468 mountpoint: fallback on stat when /proc isn't mounted
Reported-by: <dreisner@archlinux.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-10-11 10:47:44 +02:00
Dave Reisner
7982e85a61 mountpoint: return dev_t from dir_to_device
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>
2011-10-11 09:56:07 +02:00
Karel Zak
4f92adb61a mountpoint: cleanup usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-16 13:25:28 +02:00
Karel Zak
ce75b60528 build-sys: fix 'make checkincludes' warnings
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-28 13:21:00 +02:00
Karel Zak
0164c24595 mountpoint: add new command
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>
2011-06-21 11:46:36 +02:00
Renamed from libmount/samples/mountpoint.c (Browse further)