summaryrefslogtreecommitdiff
path: root/cmds-filesystem.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmds-filesystem.c')
-rw-r--r--cmds-filesystem.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index 96bdc40e..64b1cc41 100644
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -1136,21 +1136,13 @@ static int cmd_filesystem_defrag(int argc, char **argv)
close_file_or_dir(fd, dirstream);
continue;
}
- if (recursive) {
- if (S_ISDIR(st.st_mode)) {
- ret = nftw(argv[i], defrag_callback, 10,
+ if (recursive && S_ISDIR(st.st_mode)) {
+ ret = nftw(argv[i], defrag_callback, 10,
FTW_MOUNT | FTW_PHYS);
- if (ret == ENOTTY)
- exit(1);
- /* errors are handled in the callback */
- ret = 0;
- } else {
- if (defrag_global_verbose)
- printf("%s\n", argv[i]);
- ret = do_defrag(fd, defrag_global_fancy_ioctl,
- &defrag_global_range);
- e = errno;
- }
+ if (ret == ENOTTY)
+ exit(1);
+ /* errors are handled in the callback */
+ ret = 0;
} else {
if (defrag_global_verbose)
printf("%s\n", argv[i]);