]> 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>
Wed, 29 Feb 2012 13:53:31 +0000 (14:53 +0100)
commit04f087eced451ba00ac0cf1d9b101e3c6c7a322d
tree5b5a76f0ed6c9fa9d24719665dd5112cded0e4f2
parentc4137d397ce5af61054ae046db511a90f9c38055
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