aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util-linux/fstrim.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/util-linux/fstrim.c b/util-linux/fstrim.c
index 84a641022..4d90fa7a3 100644
--- a/util-linux/fstrim.c
+++ b/util-linux/fstrim.c
@@ -60,7 +60,7 @@ int fstrim_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
60int fstrim_main(int argc UNUSED_PARAM, char **argv) 60int fstrim_main(int argc UNUSED_PARAM, char **argv)
61{ 61{
62 struct fstrim_range range; 62 struct fstrim_range range;
63 char *arg_o, *arg_l, *arg_m, *bd; 63 char *arg_o, *arg_l, *arg_m, *mp;
64 unsigned opts; 64 unsigned opts;
65 int fd; 65 int fd;
66 66
@@ -94,15 +94,15 @@ int fstrim_main(int argc UNUSED_PARAM, char **argv)
94 if (opts & OPT_m) 94 if (opts & OPT_m)
95 range.minlen = xatoull_sfx(arg_m, fstrim_sfx); 95 range.minlen = xatoull_sfx(arg_m, fstrim_sfx);
96 96
97 bd = find_block_device(*(argv += optind)); 97 mp = *(argv += optind);
98 if (bd) { 98 if (find_block_device(mp)) {
99 fd = xopen_nonblocking(bd); 99 fd = xopen_nonblocking(mp);
100 xioctl(fd, FITRIM, &range); 100 xioctl(fd, FITRIM, &range);
101 if (ENABLE_FEATURE_CLEAN_UP) 101 if (ENABLE_FEATURE_CLEAN_UP)
102 close(fd); 102 close(fd);
103 103
104 if (opts & OPT_v) 104 if (opts & OPT_v)
105 printf("%s: %llu bytes were trimmed\n", bd, range.len); 105 printf("%s: %llu bytes were trimmed\n", mp, range.len);
106 return EXIT_SUCCESS; 106 return EXIT_SUCCESS;
107 } 107 }
108 return EXIT_FAILURE; 108 return EXIT_FAILURE;