summaryrefslogtreecommitdiff
path: root/props.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 /props.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 'props.c')
-rw-r--r--props.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/props.c b/props.c
index e4edba06..efa11180 100644
--- a/props.c
+++ b/props.c
@@ -110,7 +110,7 @@ static int prop_compression(enum prop_object_type type,
fd = open_file_or_dir3(object, &dirstream, open_flags);
if (fd == -1) {
ret = -errno;
- error("failed to open %s: %s", object, strerror(-ret));
+ error("failed to open %s: %m", object);
goto out;
}
@@ -133,8 +133,8 @@ static int prop_compression(enum prop_object_type type,
if (sret < 0) {
ret = -errno;
if (ret != -ENOATTR)
- error("failed to %s compression for %s: %s",
- value ? "set" : "get", object, strerror(-ret));
+ error("failed to %s compression for %s: %m",
+ value ? "set" : "get", object);
else
ret = 0;
goto out;
@@ -150,8 +150,7 @@ static int prop_compression(enum prop_object_type type,
sret = fgetxattr(fd, xattr_name, buf, len);
if (sret < 0) {
ret = -errno;
- error("failed to get compression for %s: %s",
- object, strerror(-ret));
+ error("failed to get compression for %s: %m", object);
goto out;
}
fprintf(stdout, "compression=%.*s\n", (int)len, buf);