aboutsummaryrefslogtreecommitdiffstats
path: root/cmds-fi-du.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-03-02 15:47:19 +0100
committerDavid Sterba <dsterba@suse.com>2016-03-14 13:42:47 +0100
commitd66d44eacb68112a2b935eb2d4e79edbbad8d5f0 (patch)
treef325d677696e5108a1916e0b16d7f99a1545f038 /cmds-fi-du.c
parent49fef369ffa7d66608b14640b485c16e725a9714 (diff)
downloadbtrfs-progs-d66d44eacb68112a2b935eb2d4e79edbbad8d5f0.tar.gz
btrfs-progs-d66d44eacb68112a2b935eb2d4e79edbbad8d5f0.tar.xz
btrfs-progs-d66d44eacb68112a2b935eb2d4e79edbbad8d5f0.zip
btrfs-progs: switch more error messages to common helpers
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-fi-du.c')
-rw-r--r--cmds-fi-du.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/cmds-fi-du.c b/cmds-fi-du.c
index 236318b..09d4a65 100644
--- a/cmds-fi-du.c
+++ b/cmds-fi-du.c
@@ -427,8 +427,7 @@ static int du_add_file(const char *filename, int dirfd,
return 0;
if (len > (path_max - pathp)) {
- fprintf(stderr, "ERROR: Path max exceeded: %s %s\n", path,
- filename);
+ error("path too long: %s %s", path, filename);
return ENAMETOOLONG;
}
@@ -534,7 +533,7 @@ const char * const cmd_filesystem_du_usage[] = {
int cmd_filesystem_du(int argc, char **argv)
{
- int ret = 0, error = 0;
+ int ret = 0, err = 0;
int i;
unit_mode = get_unit_mode_from_arg(&argc, argv, 1);
@@ -566,14 +565,14 @@ 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) {
- fprintf(stderr, "ERROR: can't check space of '%s': %s\n",
- argv[i], strerror(ret));
- error = 1;
+ error("cannot check space of '%s': %s", argv[i],
+ strerror(ret));
+ err = 1;
}
/* reset hard-link detection for each argument */
clear_seen_inodes();
}
- return error;
+ return err;
}