summaryrefslogtreecommitdiff
path: root/cmds-filesystem.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2018-10-25 14:10:54 +0200
committerDavid Sterba <dsterba@suse.com>2018-10-31 18:24:14 +0100
commite578b59bf612178d7727c303102049e62676c308 (patch)
treea6d6edd7fb6f34f4ce753aa9a1d787198a0e1ddf /cmds-filesystem.c
parentd59e19ca0786be2b415ca342b0fab5f222ecb702 (diff)
btrfs-progs: convert strerror to implicit %m
Similar to the changes where strerror(errno) was converted, continue with the remaining cases where the argument was stored in another variable. The savings in object size are about 4500 bytes: $ size btrfs.old btrfs.new text data bss dec hex filename 805055 24248 19748 849051 cf49b btrfs.old 804527 24248 19748 848523 cf28b btrfs.new Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-filesystem.c')
-rw-r--r--cmds-filesystem.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index 06c8311b..d1af21ee 100644
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -145,7 +145,8 @@ static int cmd_filesystem_df(int argc, char **argv)
print_df(sargs, unit_mode);
free(sargs);
} else {
- error("get_df failed %s", strerror(-ret));
+ errno = -ret;
+ error("get_df failed: %m");
}
close_file_or_dir(fd, dirstream);
@@ -1054,8 +1055,8 @@ static int cmd_filesystem_defrag(int argc, char **argv)
break;
}
if (ret) {
- error("defrag failed on %s: %s", argv[i],
- strerror(defrag_err));
+ errno = defrag_err;
+ error("defrag failed on %s: %m", argv[i]);
goto next;
}
}