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 /cmds-inspect.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 'cmds-inspect.c')
-rw-r--r-- | cmds-inspect.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cmds-inspect.c b/cmds-inspect.c index ac77a5ee..efea0331 100644 --- a/cmds-inspect.c +++ b/cmds-inspect.c @@ -330,7 +330,8 @@ static int cmd_inspect_rootid(int argc, char **argv) ret = lookup_path_rootid(fd, &rootid); if (ret) { - error("failed to lookup root id: %s", strerror(-ret)); + errno = -ret; + error("failed to lookup root id: %m"); goto out; } @@ -565,7 +566,8 @@ static int print_min_dev_size(int fd, u64 devid) ret = add_dev_extent(&holes, last_pos, btrfs_search_header_offset(sh) - 1, 1); if (ret) { - error("add device extent: %s", strerror(-ret)); + errno = -ret; + error("add device extent: %m"); ret = 1; goto out; } |