Fix -a support (broken by previous patch).
authorMatt Kraai <kraai@debian.org>
Tue, 17 Apr 2001 04:26:05 +0000 (04:26 -0000)
committerMatt Kraai <kraai@debian.org>
Tue, 17 Apr 2001 04:26:05 +0000 (04:26 -0000)
mount.c
util-linux/mount.c

diff --git a/mount.c b/mount.c
index d1568d8031a05b16464f2393c13f5f2ece53c899..311d518aa44186cc56f256dc072af468553e0d06 100644 (file)
--- a/mount.c
+++ b/mount.c
@@ -405,14 +405,14 @@ extern int mount_main(int argc, char **argv)
                argv++;
        }
 
-       if (device == NULL && directory == NULL)
-               goto goodbye;
-
        if (all == TRUE || directory == NULL) {
                struct mntent *m;
                FILE *f = setmntent("/etc/fstab", "r");
                fstabmount = TRUE;
 
+               if (all == FALSE && device == NULL)
+                       goto goodbye;
+
                if (f == NULL)
                        perror_msg_and_die( "\nCannot read /etc/fstab");
 
index d1568d8031a05b16464f2393c13f5f2ece53c899..311d518aa44186cc56f256dc072af468553e0d06 100644 (file)
@@ -405,14 +405,14 @@ extern int mount_main(int argc, char **argv)
                argv++;
        }
 
-       if (device == NULL && directory == NULL)
-               goto goodbye;
-
        if (all == TRUE || directory == NULL) {
                struct mntent *m;
                FILE *f = setmntent("/etc/fstab", "r");
                fstabmount = TRUE;
 
+               if (all == FALSE && device == NULL)
+                       goto goodbye;
+
                if (f == NULL)
                        perror_msg_and_die( "\nCannot read /etc/fstab");