summaryrefslogtreecommitdiff
path: root/util-linux/umount.c
diff options
context:
space:
mode:
authorGlenn L McGrath2004-02-22 11:35:13 +0000
committerGlenn L McGrath2004-02-22 11:35:13 +0000
commit15a4f1ee50f61cecd84cc95c38e1185faa81c03c (patch)
tree98e29e07b2695ece51c8e394b54d04995995ecc5 /util-linux/umount.c
parentdf7d84cf252a9443f748d8cef3821c7230ab54b4 (diff)
downloadbusybox-15a4f1ee50f61cecd84cc95c38e1185faa81c03c.zip
busybox-15a4f1ee50f61cecd84cc95c38e1185faa81c03c.tar.gz
Patch from Chris Larson (kergoth), to allow multiple directores to be
unmounted at once.
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 863d524..5df5970 100644
--- a/util-linux/umount.c
+++ b/util-linux/umount.c
@@ -238,7 +238,7 @@ static int umount_all(void)
extern int umount_main(int argc, char **argv)
{
- char path[PATH_MAX];
+ char path[PATH_MAX], result = 0;
if (argc < 2) {
bb_show_usage();
@@ -286,10 +286,13 @@ extern int umount_main(int argc, char **argv)
else
return EXIT_FAILURE;
}
- if (realpath(*argv, path) == NULL)
- bb_perror_msg_and_die("%s", path);
- if (do_umount(path))
- return EXIT_SUCCESS;
- bb_perror_msg_and_die("%s", *argv);
-}
+ do {
+ if (realpath(*argv, path) != NULL)
+ if (do_umount(path))
+ continue;
+ bb_perror_msg("%s", path);
+ result++;
+ } while (--argc > 0 && ++argv);
+ return result;
+}