summaryrefslogtreecommitdiff
path: root/cmds-property.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-property.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-property.c')
-rw-r--r--cmds-property.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/cmds-property.c b/cmds-property.c
index 03bafa05..7b0a6ffa 100644
--- a/cmds-property.c
+++ b/cmds-property.c
@@ -91,7 +91,8 @@ static int check_is_root(const char *object)
ret = get_fsid(object, fsid, 0);
if (ret < 0) {
- error("get_fsid for %s failed: %s", object, strerror(-ret));
+ errno = -ret;
+ error("get_fsid for %s failed: %m", object);
goto out;
}
@@ -103,7 +104,8 @@ static int check_is_root(const char *object)
ret = 1;
goto out;
} else if (ret < 0) {
- error("get_fsid for %s failed: %s", tmp, strerror(-ret));
+ errno = -ret;
+ error("get_fsid for %s failed: %m", tmp);
goto out;
}
@@ -317,8 +319,8 @@ static void parse_args(int argc, char **argv,
if (!*types) {
ret = autodetect_object_types(*object, types);
if (ret < 0) {
- error("failed to detect object type: %s",
- strerror(-ret));
+ errno = -ret;
+ error("failed to detect object type: %m");
usage(usage_str);
}
if (!*types) {