aboutsummaryrefslogtreecommitdiff
path: root/util-linux/umount.c
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux/umount.c')
-rw-r--r--util-linux/umount.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/util-linux/umount.c b/util-linux/umount.c
index 863d52476..5df597028 100644
--- a/util-linux/umount.c
+++ b/util-linux/umount.c
@@ -238,7 +238,7 @@ static int umount_all(void)
238 238
239extern int umount_main(int argc, char **argv) 239extern int umount_main(int argc, char **argv)
240{ 240{
241 char path[PATH_MAX]; 241 char path[PATH_MAX], result = 0;
242 242
243 if (argc < 2) { 243 if (argc < 2) {
244 bb_show_usage(); 244 bb_show_usage();
@@ -286,10 +286,13 @@ extern int umount_main(int argc, char **argv)
286 else 286 else
287 return EXIT_FAILURE; 287 return EXIT_FAILURE;
288 } 288 }
289 if (realpath(*argv, path) == NULL)
290 bb_perror_msg_and_die("%s", path);
291 if (do_umount(path))
292 return EXIT_SUCCESS;
293 bb_perror_msg_and_die("%s", *argv);
294}
295 289
290 do {
291 if (realpath(*argv, path) != NULL)
292 if (do_umount(path))
293 continue;
294 bb_perror_msg("%s", path);
295 result++;
296 } while (--argc > 0 && ++argv);
297 return result;
298}