]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: (umount) make mnt_stat_mountpoin() usable for relative paths
authorKarel Zak <kzak@redhat.com>
Mon, 10 Dec 2018 15:25:08 +0000 (16:25 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 10 Dec 2018 15:25:08 +0000 (16:25 +0100)
 # mount -o loop devicefile /mnt/test
 # umount devicefile
 umount: devicefile: not mounted.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1653781
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/utils.c

index 4f4d10bf923f4d9f8b449a411502255f9721d70b..6d88717176e06d30c49afd169239405721b6edb8 100644 (file)
@@ -126,7 +126,7 @@ static int fstype_cmp(const void *v1, const void *v2)
 int mnt_stat_mountpoint(const char *target, struct stat *st)
 {
 #ifdef AT_NO_AUTOMOUNT
-       return fstatat(-1, target, st, AT_NO_AUTOMOUNT);
+       return fstatat(AT_FDCWD, target, st, AT_NO_AUTOMOUNT);
 #else
        return stat(target, st);
 #endif