From 633dc6f80f201afdf5b8524ae377187d58f0ef3b Mon Sep 17 00:00:00 2001 From: David Sterba Date: Tue, 12 Jan 2016 11:20:18 +0100 Subject: 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 --- cmds-fi-usage.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'cmds-fi-usage.c') 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; } -- cgit v1.2.3