summaryrefslogtreecommitdiff
path: root/cmds-subvolume.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-01-12 11:20:18 +0100
committerDavid Sterba <dsterba@suse.com>2016-01-12 15:02:55 +0100
commit633dc6f80f201afdf5b8524ae377187d58f0ef3b (patch)
treeca5b6375fb6910ac51eea8b89173c45390ce0355 /cmds-subvolume.c
parent374d67fdef869d2e2dfb9907d21c85ee6c19e1d7 (diff)
downloadbtrfs-progs-633dc6f80f201afdf5b8524ae377187d58f0ef3b.tar.gz
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-subvolume.c')
-rw-r--r--cmds-subvolume.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/cmds-subvolume.c b/cmds-subvolume.c
index ae3fb7c..424b00b 100644
--- a/cmds-subvolume.c
+++ b/cmds-subvolume.c
@@ -264,7 +264,7 @@ static const char * const cmd_subvol_delete_usage[] = {
static int cmd_subvol_delete(int argc, char **argv)
{
- int res, e, ret = 0;
+ int res, ret = 0;
int cnt;
int fd = -1;
struct btrfs_ioctl_vol_args args;
@@ -355,10 +355,9 @@ again:
memset(&args, 0, sizeof(args));
strncpy_null(args.name, vname);
res = ioctl(fd, BTRFS_IOC_SNAP_DESTROY, &args);
- e = errno;
-
if(res < 0 ){
- error("cannot delete '%s/%s': %s", dname, vname, strerror(e));
+ error("cannot delete '%s/%s': %s", dname, vname,
+ strerror(errno));
ret = 1;
goto out;
}