From e578b59bf612178d7727c303102049e62676c308 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Thu, 25 Oct 2018 14:10:54 +0200 Subject: 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 --- props.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'props.c') 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); -- cgit v1.2.3