diff options
author | David Sterba <dsterba@suse.com> | 2016-01-12 11:20:18 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-01-12 15:02:55 +0100 |
commit | 633dc6f80f201afdf5b8524ae377187d58f0ef3b (patch) | |
tree | ca5b6375fb6910ac51eea8b89173c45390ce0355 /cmds-fi-usage.c | |
parent | 374d67fdef869d2e2dfb9907d21c85ee6c19e1d7 (diff) |
btrfs-progs: remove unnecessary errno temp variables
We can read errno directly if it's not clobbered by any intermediate
calls.
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-fi-usage.c')
-rw-r--r-- | cmds-fi-usage.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/cmds-fi-usage.c b/cmds-fi-usage.c index d6e56e96..356ed04a 100644 --- a/cmds-fi-usage.c +++ b/cmds-fi-usage.c @@ -228,7 +228,7 @@ static int cmp_btrfs_ioctl_space_info(const void *a, const void *b) static struct btrfs_ioctl_space_args *load_space_info(int fd, char *path) { struct btrfs_ioctl_space_args *sargs = NULL, *sargs_orig = NULL; - int e, ret, count; + int ret, count; sargs_orig = sargs = calloc(1, sizeof(struct btrfs_ioctl_space_args)); if (!sargs) { @@ -240,9 +240,9 @@ static struct btrfs_ioctl_space_args *load_space_info(int fd, char *path) sargs->total_spaces = 0; ret = ioctl(fd, BTRFS_IOC_SPACE_INFO, sargs); - e = errno; if (ret) { - error("cannot get space info on '%s': %s", path, strerror(e)); + error("cannot get space info on '%s': %s", path, + strerror(errno)); free(sargs); return NULL; } @@ -266,11 +266,9 @@ static struct btrfs_ioctl_space_args *load_space_info(int fd, char *path) sargs->total_spaces = 0; ret = ioctl(fd, BTRFS_IOC_SPACE_INFO, sargs); - e = errno; - if (ret) { error("cannot get space info with %u slots: %s", - count, strerror(e)); + count, strerror(errno)); free(sargs); return NULL; } |