Fix the exit status of umount -a, a casualty of the TRUE/FALSE normalization.
authorMatt Kraai <kraai@debian.org>
Wed, 17 Jan 2001 00:12:11 +0000 (00:12 -0000)
committerMatt Kraai <kraai@debian.org>
Wed, 17 Jan 2001 00:12:11 +0000 (00:12 -0000)
Thanks to Francois-R Boyer <boyerf@IRO.UMontreal.CA> for the report.

umount.c
util-linux/umount.c

index 0867118c0afd91339cd881f95ab9aeb029ea6ce1..40d25f90a42e82d3be0a42c014532661a7cec6f1 100644 (file)
--- a/umount.c
+++ b/umount.c
@@ -212,18 +212,18 @@ static int umount_all(int useMtab)
                /* Never umount /proc on a umount -a */
                if (strstr(mountpt, "proc")!= NULL)
                        continue;
-               status = do_umount(mountpt, useMtab);
-               if (status != 0) {
+               if (!do_umount(mountpt, useMtab)) {
                        /* Don't bother retrying the umount on busy devices */
                        if (errno == EBUSY) {
                                perror_msg("%s", mountpt);
+                               status = FALSE;
                                continue;
                        }
-                       status = do_umount(mountpt, useMtab);
-                       if (status != 0) {
+                       if (!do_umount(mountpt, useMtab)) {
                                printf("Couldn't umount %s on %s: %s\n",
                                           mountpt, mtab_getinfo(mountpt, MTAB_GETDEVICE),
                                           strerror(errno));
+                               status = FALSE;
                        }
                }
        }
index 0867118c0afd91339cd881f95ab9aeb029ea6ce1..40d25f90a42e82d3be0a42c014532661a7cec6f1 100644 (file)
@@ -212,18 +212,18 @@ static int umount_all(int useMtab)
                /* Never umount /proc on a umount -a */
                if (strstr(mountpt, "proc")!= NULL)
                        continue;
-               status = do_umount(mountpt, useMtab);
-               if (status != 0) {
+               if (!do_umount(mountpt, useMtab)) {
                        /* Don't bother retrying the umount on busy devices */
                        if (errno == EBUSY) {
                                perror_msg("%s", mountpt);
+                               status = FALSE;
                                continue;
                        }
-                       status = do_umount(mountpt, useMtab);
-                       if (status != 0) {
+                       if (!do_umount(mountpt, useMtab)) {
                                printf("Couldn't umount %s on %s: %s\n",
                                           mountpt, mtab_getinfo(mountpt, MTAB_GETDEVICE),
                                           strerror(errno));
+                               status = FALSE;
                        }
                }
        }