]> git.ipfire.org Git - thirdparty/util-linux.git/commit
mountpoint: fix a minor bug with 0:0 devno
authorZhi Li <lizhi1215@gmail.com>
Wed, 29 Feb 2012 08:28:49 +0000 (16:28 +0800)
committerKarel Zak <kzak@redhat.com>
Tue, 13 Mar 2012 11:42:22 +0000 (12:42 +0100)
commitaadfcc2759b9acd99e539b9fbaef313d932107b9
tree700e27331fad80786628888301356b1a69a9da5b
parentdd0b15ead3c6d6f96b621dad1e67cfdfc3e6da11
mountpoint: fix a minor bug with 0:0 devno

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>
sys-utils/mountpoint.c