diff options
author | Karel Zak | 2018-05-18 12:33:03 +0200 |
---|---|---|
committer | Karel Zak | 2018-06-21 13:07:46 +0200 |
commit | c7df0f42b761929fe92e4706990976bfdc638179 (patch) | |
tree | 73bed8bd2799651c40a76097ebbdda7e654c09ce /lib | |
parent | chcpu: use new ul_path_* API (diff) | |
download | kernel-qcow2-util-linux-c7df0f42b761929fe92e4706990976bfdc638179.tar.gz kernel-qcow2-util-linux-c7df0f42b761929fe92e4706990976bfdc638179.tar.xz kernel-qcow2-util-linux-c7df0f42b761929fe92e4706990976bfdc638179.zip |
lib/path: add more debug messages
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/path.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/path.c b/lib/path.c index b1e4d21f7..11cab3aaf 100644 --- a/lib/path.c +++ b/lib/path.c @@ -255,6 +255,7 @@ int ul_path_access(struct path_cxt *pc, int mode, const char *path) if (dir < 0) return dir; + DBG(CXT, ul_debugobj(pc, "access: '%s'", path)); rc = faccessat(dir, path, mode, 0); if (rc && errno == ENOENT @@ -283,7 +284,7 @@ int ul_path_open(struct path_cxt *pc, int flags, const char *path) if (!pc) { fd = open(path, flags); - DBG(CXT, ul_debug("opening '%s'", path)); + DBG(CXT, ul_debug("opening [%d] '%s'", flags, path)); } else { int dir = ul_path_get_dirfd(pc); if (dir < 0) @@ -296,7 +297,7 @@ int ul_path_open(struct path_cxt *pc, int flags, const char *path) && 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 [%d] '%s'", flags, path)); } return fd; } @@ -500,6 +501,7 @@ int ul_path_read(struct path_cxt *pc, char *buf, size_t len, const char *path) if (fd < 0) return -errno; + DBG(CXT, ul_debug(" reading '%s'", path)); rc = read_all(fd, buf, len); errsv = errno; @@ -615,6 +617,8 @@ int ul_path_scanf(struct path_cxt *pc, const char *path, const char *fmt, ...) if (!f) return -EINVAL; + DBG(CXT, ul_debug(" fscanf [%s] '%s'", fmt, path)); + va_start(fmt_ap, fmt); rc = vfscanf(f, fmt, fmt_ap); va_end(fmt_ap); |