about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2015-03-10 18:33:50 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2015-03-10 18:33:50 +0000
commit59ef4c53bef7cb032199620b8cba59a037f8decd (patch)
treeb11e31cd18ebe4b548af86f3eca903ed0a1fdab0 /src
parentb178fe4278e515034bc8f992658bebe515b138fd (diff)
downloads6-linux-utils-59ef4c53bef7cb032199620b8cba59a037f8decd.tar.gz
s6-linux-utils-59ef4c53bef7cb032199620b8cba59a037f8decd.tar.xz
s6-linux-utils-59ef4c53bef7cb032199620b8cba59a037f8decd.zip
- add -n to s6-mount
 - s6-mount doc fixes
Diffstat (limited to 'src')
-rw-r--r--src/minutils/s6-mount.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/minutils/s6-mount.c b/src/minutils/s6-mount.c
index 6970c05..318a4a0 100644
--- a/src/minutils/s6-mount.c
+++ b/src/minutils/s6-mount.c
@@ -10,7 +10,7 @@
 #include <skalibs/djbunix.h>
 #include "mount-constants.h"
 
-#define USAGE "s6-mount -a [ -z fstab ] | s6-mount [ -t type ] [ -o option[,option...] ]... device mountpoint"
+#define USAGE "s6-mount -a [ -z fstab ] | s6-mount [ -n ] [ -t type ] [ -o option[,option...] ]... device mountpoint"
 #define BUFSIZE 4096
 
 #define SWITCH(opt) do
@@ -93,15 +93,17 @@ int main (int argc, char const *const *argv)
   char const *fstab = "/etc/fstab" ;
   PROG = "s6-mount" ;
   {
+    int doall = 0 ;
     subgetopt_t l = SUBGETOPT_ZERO ;
     for (;;)
     {
-      register int opt = subgetopt_r(argc, argv, "z:arwt:o:", &l) ;
+      register int opt = subgetopt_r(argc, argv, "nz:arwt:o:", &l) ;
       if (opt == -1) break ;
       switch (opt)
       {
+        case 'n' : break ;
         case 'z' : fstab = l.arg ; break ;
-        case 'a' : return mountall(fstab) ;
+        case 'a' : doall = 1 ; break ;
         case 't' : fstype = l.arg ; break ;
         case 'w' : scanopt(&data, &flags, "rw") ; break ;
         case 'r' : scanopt(&data, &flags, "ro") ; break ;
@@ -110,6 +112,7 @@ int main (int argc, char const *const *argv)
       }
     }
     argc -= l.ind ; argv += l.ind ;
+    if (doall) return mountall(fstab) ;
   }
   if (!argc)
   {