summaryrefslogtreecommitdiff
path: root/cmds-filesystem.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-12-12 18:22:10 +0100
committerDavid Sterba <dsterba@suse.com>2016-12-14 15:06:36 +0100
commitcc0a80b8f2fc36ca486ae224a4bea6d3e89917bd (patch)
tree5f100d74ab2aaa1162803e7deaffba85c4d7f0a6 /cmds-filesystem.c
parent8e2bd38f2989c76d80c5b21fac3f839fcce24e4d (diff)
btrfs-progs: defrag: cleanup temporary errno value
Rename a single letter variable and move the defintion to the scope of use. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-filesystem.c')
-rw-r--r--cmds-filesystem.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index 64b1cc41..eb16875d 100644
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -1036,7 +1036,6 @@ static int cmd_filesystem_defrag(int argc, char **argv)
int i;
int recursive = 0;
int ret = 0;
- int e = 0;
int compress_type = BTRFS_COMPRESS_NONE;
DIR *dirstream;
@@ -1112,6 +1111,7 @@ static int cmd_filesystem_defrag(int argc, char **argv)
for (i = optind; i < argc; i++) {
struct stat st;
+ int defrag_err = 0;
dirstream = NULL;
fd = open_file_or_dir(argv[i], &dirstream);
@@ -1148,10 +1148,10 @@ static int cmd_filesystem_defrag(int argc, char **argv)
printf("%s\n", argv[i]);
ret = do_defrag(fd, defrag_global_fancy_ioctl,
&defrag_global_range);
- e = errno;
+ defrag_err = errno;
}
close_file_or_dir(fd, dirstream);
- if (ret && e == ENOTTY && defrag_global_fancy_ioctl) {
+ if (ret && defrag_err == ENOTTY && defrag_global_fancy_ioctl) {
error("defrag range ioctl not "
"supported in this kernel, please try "
"without any options.");
@@ -1159,7 +1159,8 @@ static int cmd_filesystem_defrag(int argc, char **argv)
break;
}
if (ret) {
- error("defrag failed on %s: %s", argv[i], strerror(e));
+ error("defrag failed on %s: %s", argv[i],
+ strerror(defrag_err));
defrag_global_errors++;
}
}