summaryrefslogtreecommitdiff
path: root/cmds-fi-du.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmds-fi-du.c')
-rw-r--r--cmds-fi-du.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/cmds-fi-du.c b/cmds-fi-du.c
index 4e639f6d..496a55b8 100644
--- a/cmds-fi-du.c
+++ b/cmds-fi-du.c
@@ -406,9 +406,10 @@ static int du_walk_dir(struct du_dir_ctxt *ctxt, struct rb_root *shared_extents)
ret = 0;
continue;
} else if (ret) {
+ errno = -ret;
fprintf(stderr,
- "failed to walk dir/file: %s :%s\n",
- entry->d_name, strerror(-ret));
+ "failed to walk dir/file: %s : %m\n",
+ entry->d_name);
break;
}
@@ -601,8 +602,8 @@ int cmd_filesystem_du(int argc, char **argv)
for (i = optind; i < argc; i++) {
ret = du_add_file(argv[i], AT_FDCWD, NULL, NULL, NULL, 1);
if (ret) {
- error("cannot check space of '%s': %s", argv[i],
- strerror(-ret));
+ errno = -ret;
+ error("cannot check space of '%s': %m", argv[i]);
err = 1;
}