summaryrefslogtreecommitdiffstats
path: root/libmount/src/context.c
diff options
context:
space:
mode:
authorKarel Zak2015-12-09 10:26:16 +0100
committerKarel Zak2015-12-09 10:26:16 +0100
commit6589a1632b313db1304b673a6ce41a48f203eb98 (patch)
treebf8398e1a37e228359235121a9901a49b4e835fe /libmount/src/context.c
parentlibmount: add cgroup2 pseudo FS (diff)
downloadkernel-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.c')
-rw-r--r--libmount/src/context.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libmount/src/context.c b/libmount/src/context.c
index 5ab0b794e..7b965a07f 100644
--- a/libmount/src/context.c
+++ b/libmount/src/context.c
@@ -1069,7 +1069,7 @@ int mnt_context_get_mtab_for_target(struct libmnt_context *cxt,
char *cn_tgt = NULL;
int rc;
- if (stat(tgt, &st) == 0 && S_ISDIR(st.st_mode)) {
+ if (mnt_stat_mountpoint(tgt, &st) == 0 && S_ISDIR(st.st_mode)) {
cache = mnt_context_get_cache(cxt);
cn_tgt = mnt_resolve_path(tgt, cache);
if (cn_tgt)
@@ -1540,7 +1540,7 @@ static int mkdir_target(const char *tgt, struct libmnt_fs *fs)
if (mnt_optstr_get_option(fs->user_optstr, "x-mount.mkdir", &mstr, &mstr_sz) != 0)
return 0;
- if (stat(tgt, &st) == 0)
+ if (mnt_stat_mountpoint(tgt, &st) == 0)
return 0;
if (mstr && mstr_sz) {