set localroot to - to not create #Z - vx32 - Local 9vx git repository for patches.
Log
Files
Refs
---
commit 0018e7182c4aae8db0a756dd84b73e287484e682
parent 36849359db1b0a6eb5ab508041e9db97ab2ca6f3
Author: Jesus Galan Lopez (yiyus) 
Date:   Sat, 11 Sep 2010 17:46:19 +0200

set localroot to - to not create #Z

Diffstat:
  doc/9vx.1                           |      20 +++++++++++++-------
  src/9vx/devtab.c                    |       3 ++-
  src/9vx/main.c                      |      13 +++++++++++--

3 files changed, 26 insertions(+), 10 deletions(-)
---
diff --git a/doc/9vx.1 b/doc/9vx.1
@@ -16,7 +16,7 @@
 .I -p 9vx.ini
 ]
 t[
-.I -r root
+.I -r localroot
 ]
 t[
 .I -u user
@@ -33,7 +33,7 @@
 .I -p 9vx.ini
 ]
 t[
-.I -r root
+.I -r localroot
 ]
 t[
 .I -u user
@@ -57,16 +57,22 @@ Options can be passed to
 .I 9vx
 as command line arguments or in a configuration file specified with the
 .I -p
-option (see below). The host file server will be visible from inside as
-.I #Z.
+option (see below). 
 One or more
 .I bootargs
 arguments will be passed to boot/boot as explained in boot(8), with the addition that
-tthe local method also supports local directories. The
+tthe local method also supports local directories.
+The
 .I -r
 option sets
-.I nobootprompt=local!#Z/root
-tto boot from a local directory containing a Plan 9 tree.
+.I nobootprompt=local!#Z/localroot
+tto boot from a local directory containing a Plan 9 tree
+(the host file server can be accessed
+from inside through
+.I #Z,
+unless localroot is set to
+.L -
+).
 If an
 .I user
 is not specified, the current user in the host operating system will be used.
diff --git a/src/9vx/devtab.c b/src/9vx/devtab.c
@@ -37,7 +37,6 @@ Dev *devtab[] = {
         &dupdevtab,
         &envdevtab,
         ðerdevtab,
-        &fsdevtab,
         &ipdevtab,
         &mntdevtab,
         &mntloopdevtab,
@@ -49,5 +48,7 @@ Dev *devtab[] = {
         &srvdevtab,
         &ssldevtab,
         &tlsdevtab,
+        // must be the last one, can change to 0
+        &fsdevtab,
         0
 };
diff --git a/src/9vx/main.c b/src/9vx/main.c
@@ -82,6 +82,7 @@ nop(void)
 int
 main(int argc, char **argv)
 {
+        int fsdev;
         int vetap;
         char *vedev;
         char *inifile;
@@ -190,7 +191,14 @@ main(int argc, char **argv)
         /*
          * bootargs have preference over -r
          */
-        if(bootargc > 0)
+        fsdev = strcmp(localroot, "-");
+        if(strcmp(localroot, "-") == 0){
+                int i;
+                for(i=0; devtab[i] && devtab[i] != &fsdevtab; i++)
+                        ;
+                devtab[i] = 0;
+        }
+        if(bootargc > 0 || !fsdev)
                 localroot = nil;
 
         inifields(&iniopt);
@@ -240,7 +248,8 @@ main(int argc, char **argv)
         if(!singlethread){
                 if(nve == 0)
                         makekprocdev(&ipdevtab);
-                makekprocdev(&fsdevtab);
+                if(fsdev)
+                        makekprocdev(&fsdevtab);
                 makekprocdev(&drawdevtab);
                 makekprocdev(&audiodevtab);
                 if(nocpuload == 0)