diff options
author | Karel Zak | 2015-12-09 10:26:16 +0100 |
---|---|---|
committer | Karel Zak | 2015-12-09 10:26:16 +0100 |
commit | 6589a1632b313db1304b673a6ce41a48f203eb98 (patch) | |
tree | bf8398e1a37e228359235121a9901a49b4e835fe /libmount/src/context_umount.c | |
parent | libmount: add cgroup2 pseudo FS (diff) | |
download | kernel-qcow2-util-linux-6589a1632b313db1304b673a6ce41a48f203eb98.tar.gz kernel-qcow2-util-linux-6589a1632b313db1304b673a6ce41a48f203eb98.tar.xz kernel-qcow2-util-linux-6589a1632b313db1304b673a6ce41a48f203eb98.zip |
libmount: use fstatat(AT_NO_AUTOMOUNT) for mountpoints
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/context_umount.c')
-rw-r--r-- | libmount/src/context_umount.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libmount/src/context_umount.c b/libmount/src/context_umount.c index c4e9ebbee..b67f48b91 100644 --- a/libmount/src/context_umount.c +++ b/libmount/src/context_umount.c @@ -129,7 +129,7 @@ try_loopdev: */ struct stat st; - if (stat(tgt, &st) == 0 && S_ISREG(st.st_mode)) { + if (mnt_stat_mountpoint(tgt, &st) == 0 && S_ISREG(st.st_mode)) { int count; struct libmnt_cache *cache = mnt_context_get_cache(cxt); const char *bf = cache ? mnt_resolve_path(tgt, cache) : tgt; @@ -242,7 +242,7 @@ static int lookup_umount_fs(struct libmnt_context *cxt) && !mnt_context_is_force(cxt) && !mnt_context_is_lazy(cxt) && !mnt_context_is_loopdel(cxt) - && stat(tgt, &st) == 0 && S_ISDIR(st.st_mode) + && mnt_stat_mountpoint(tgt, &st) == 0 && S_ISDIR(st.st_mode) && !has_utab_entry(cxt, tgt)) { const char *type = mnt_fs_get_fstype(cxt->fs); |