diff options
author | Karel Zak | 2018-05-29 12:41:48 +0200 |
---|---|---|
committer | Karel Zak | 2018-06-21 13:19:28 +0200 |
commit | eb4a75afd97ef1d746373c751deb6857a13111a0 (patch) | |
tree | 4650160c4f729fe4e22c5d9240c6a4e7246cd3ab /lib | |
parent | fstrim: add --dry-run (diff) | |
download | kernel-qcow2-util-linux-eb4a75afd97ef1d746373c751deb6857a13111a0.tar.gz kernel-qcow2-util-linux-eb4a75afd97ef1d746373c751deb6857a13111a0.tar.xz kernel-qcow2-util-linux-eb4a75afd97ef1d746373c751deb6857a13111a0.zip |
lib/path: improve debug message on redirect
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/path.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/path.c b/lib/path.c index d35262b89..cfc1c2372 100644 --- a/lib/path.c +++ b/lib/path.c @@ -274,7 +274,6 @@ int ul_path_access(struct path_cxt *pc, int mode, const char *path) && pc->redirect_on_enoent && pc->redirect_on_enoent(pc, path, &dir) == 0) rc = faccessat(dir, path, mode, 0); - return rc; } @@ -298,18 +297,19 @@ int ul_path_open(struct path_cxt *pc, int flags, const char *path) fd = open(path, flags); DBG(CXT, ul_debug("opening '%s'", path)); } else { + int fdx; int dir = ul_path_get_dirfd(pc); if (dir < 0) return dir; - fd = openat(dir, path, flags); + fdx = fd = openat(dir, path, flags); if (fd < 0 && errno == ENOENT && pc->redirect_on_enoent && pc->redirect_on_enoent(pc, path, &dir) == 0) fd = openat(dir, path, flags); - DBG(CXT, ul_debugobj(pc, "opening '%s'", path)); + DBG(CXT, ul_debugobj(pc, "opening '%s'%s", path, fdx != fd ? " [redirected]" : "")); } return fd; } |