aboutsummaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-11-12 17:23:45 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-11-12 17:23:45 +0000
commit1119972f917db59ccb7c74daebf5a0688e9d0e24 (patch)
tree4c0e0a039db74e90d8de0f3f9c73c9134ae2ce81 /util-linux
parent6c5e5a0e85af5016600d70a06db8563e17ad3814 (diff)
downloadbusybox-1119972f917db59ccb7c74daebf5a0688e9d0e24.tar.gz
umount: umount -a shouldn't stop on first failure
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/umount.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/util-linux/umount.c b/util-linux/umount.c
index 9c551f986..6ba72aed1 100644
--- a/util-linux/umount.c
+++ b/util-linux/umount.c
@@ -54,11 +54,12 @@ int umount_main(int argc, char **argv)
/* If we're umounting all, then m points to the start of the list and
* the argument list should be empty (which will match all). */
- if (!(fp = setmntent(bb_path_mtab_file, "r"))) {
+ fp = setmntent(bb_path_mtab_file, "r");
+ if (!fp) {
if (opt & OPT_ALL)
bb_error_msg_and_die("cannot open %s", bb_path_mtab_file);
} else {
- while (getmntent_r(fp,&me,path,sizeof(path))) {
+ while (getmntent_r(fp, &me, path, sizeof(path))) {
m = xmalloc(sizeof(struct mtab_list));
m->next = mtl;
m->device = xstrdup(me.mnt_fsname);
@@ -68,7 +69,7 @@ int umount_main(int argc, char **argv)
endmntent(fp);
}
- /* If we're not mounting all, we need at least one argument. */
+ /* If we're not umounting all, we need at least one argument. */
if (!(opt & OPT_ALL)) {
m = 0;
if (!argc) bb_show_usage();
@@ -104,7 +105,7 @@ int umount_main(int argc, char **argv)
if (curstat && doForce) {
curstat = umount2(zapit, doForce);
if (curstat)
- bb_error_msg_and_die("forced umount of %s failed!", zapit);
+ bb_error_msg("forced umount of %s failed!", zapit);
}
// If still can't umount, maybe remount read-only?
@@ -130,7 +131,7 @@ int umount_main(int argc, char **argv)
// Note this means that "umount /dev/blah" will unmount all instances
// of /dev/blah, not just the most recent.
while (m && (m = m->next))
- if ((opt & OPT_ALL) || !strcmp(path,m->device))
+ if ((opt & OPT_ALL) || !strcmp(path, m->device))
break;
}