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 /check/mode-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 'check/mode-common.c')
-rw-r--r-- | check/mode-common.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/check/mode-common.c b/check/mode-common.c index 15e2bbd1..005be8a3 100644 --- a/check/mode-common.c +++ b/check/mode-common.c @@ -450,7 +450,8 @@ int link_inode_to_lostfound(struct btrfs_trans_handle *trans, BTRFS_FIRST_FREE_OBJECTID, &lost_found_ino, mode); if (ret < 0) { - error("failed to create '%s' dir: %s", dir_name, strerror(-ret)); + errno = -ret; + error("failed to create '%s' dir: %m", dir_name); goto out; } ret = btrfs_add_link(trans, root, ino, lost_found_ino, @@ -474,8 +475,9 @@ int link_inode_to_lostfound(struct btrfs_trans_handle *trans, name_len, filetype, NULL, 1, 0); } if (ret < 0) { - error("failed to link the inode %llu to %s dir: %s", - ino, dir_name, strerror(-ret)); + errno = -ret; + error("failed to link the inode %llu to %s dir: %m", + ino, dir_name); goto out; } |