diff options
author | Glenn L McGrath <bug1@ihug.co.nz> | 2004-02-22 11:35:13 +0000 |
---|---|---|
committer | Glenn L McGrath <bug1@ihug.co.nz> | 2004-02-22 11:35:13 +0000 |
commit | 15a4f1ee50f61cecd84cc95c38e1185faa81c03c (patch) | |
tree | 98e29e07b2695ece51c8e394b54d04995995ecc5 | |
parent | df7d84cf252a9443f748d8cef3821c7230ab54b4 (diff) | |
download | busybox-w32-15a4f1ee50f61cecd84cc95c38e1185faa81c03c.tar.gz busybox-w32-15a4f1ee50f61cecd84cc95c38e1185faa81c03c.tar.bz2 busybox-w32-15a4f1ee50f61cecd84cc95c38e1185faa81c03c.zip |
Patch from Chris Larson (kergoth), to allow multiple directores to be
unmounted at once.
-rw-r--r-- | docs/busybox.sgml | 2 | ||||
-rw-r--r-- | util-linux/umount.c | 17 |
2 files changed, 11 insertions, 8 deletions
diff --git a/docs/busybox.sgml b/docs/busybox.sgml index b54d68ee5..bd8b1697c 100644 --- a/docs/busybox.sgml +++ b/docs/busybox.sgml | |||
@@ -3441,7 +3441,7 @@ | |||
3441 | <title>umount</title> | 3441 | <title>umount</title> |
3442 | 3442 | ||
3443 | <para> | 3443 | <para> |
3444 | Usage: umount [OPTION]... DEVICE|DIRECTORY | 3444 | Usage: umount [OPTION]... DEVICE|DIRECTORY [...] |
3445 | </para> | 3445 | </para> |
3446 | 3446 | ||
3447 | <para> | 3447 | <para> |
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 | ||
239 | extern int umount_main(int argc, char **argv) | 239 | extern 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 | } | ||