diff options
author | David Sterba <dsterba@suse.com> | 2018-10-25 14:10:54 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-10-31 18:24:14 +0100 |
commit | e578b59bf612178d7727c303102049e62676c308 (patch) | |
tree | a6d6edd7fb6f34f4ce753aa9a1d787198a0e1ddf /mkfs/common.c | |
parent | d59e19ca0786be2b415ca342b0fab5f222ecb702 (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 'mkfs/common.c')
-rw-r--r-- | mkfs/common.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mkfs/common.c b/mkfs/common.c index 0ace262b..f7e3badc 100644 --- a/mkfs/common.c +++ b/mkfs/common.c @@ -714,7 +714,8 @@ int test_dev_for_mkfs(const char *file, int force_overwrite) ret = is_swap_device(file); if (ret < 0) { - error("checking status of %s: %s", file, strerror(-ret)); + errno = -ret; + error("checking status of %s: %m", file); return 1; } if (ret == 1) { @@ -760,8 +761,8 @@ int test_status_for_mkfs(const char *file, bool force_overwrite) } ret = check_mounted(file); if (ret < 0) { - error("cannot check mount status of %s: %s", file, - strerror(-ret)); + errno = -ret; + error("cannot check mount status of %s: %m", file); return 1; } if (ret == 1) { |