tadd -a aname - plan9port - [fork] Plan 9 from user space | |
git clone git://src.adamsgaard.dk/plan9port | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 9ec386fef4927034303b7e477f1570c09fba527f | |
parent 6654bd74cbcac31835b75cc473132c9a844073e4 | |
Author: rsc <devnull@localhost> | |
Date: Thu, 21 Jun 2007 02:11:21 +0000 | |
add -a aname | |
Diffstat: | |
M man/man4/9pfuse.4 | 18 +++++++++--------- | |
M src/cmd/9pfuse/main.c | 16 ++++++++++------ | |
2 files changed, 19 insertions(+), 15 deletions(-) | |
--- | |
diff --git a/man/man4/9pfuse.4 b/man/man4/9pfuse.4 | |
t@@ -7,12 +7,12 @@ | |
.B -D | |
] | |
[ | |
-.B -a | |
+.B -A | |
.I t | |
] | |
[ | |
-.B -e | |
-.I t | |
+.B -a | |
+.I aname | |
] | |
.I addr | |
.I mtpt | |
t@@ -34,16 +34,16 @@ The options are: | |
.B -D | |
Print each FUSE and 9P message to standard error. | |
.TP | |
-.B -a\fI t | |
+.B -a\fI aname | |
+Use | |
+.I aname | |
+as the attach name. | |
+.TP | |
+.B -A\fI t | |
Set the kernel cache timeout for attribute information | |
to | |
.I t | |
(default 1.0) seconds. | |
-.TP | |
-.B -e\fI t | |
-Set the kernel cache timeout for directory entries to | |
-.I t | |
-(default 1.0) seconds. | |
.PD | |
.PP | |
The | |
diff --git a/src/cmd/9pfuse/main.c b/src/cmd/9pfuse/main.c | |
t@@ -33,6 +33,7 @@ | |
int debug; | |
char *argv0; | |
+char *aname = ""; | |
void fusedispatch(void*); | |
Channel *fusechan; | |
t@@ -57,12 +58,12 @@ double entrytimeout = 1.0; | |
CFsys *fsys; | |
CFid *fsysroot; | |
-void init9p(char*); | |
+void init9p(char*, char*); | |
void | |
usage(void) | |
{ | |
- fprint(2, "usage: 9pfuse [-D] [-a attrtimeout] address mtpt\n"); | |
+ fprint(2, "usage: 9pfuse [-D] [-A attrtimeout] [-a aname] address mtpt… | |
exit(1); | |
} | |
t@@ -76,9 +77,12 @@ threadmain(int argc, char **argv) | |
chatty9pclient++; | |
debug++; | |
break; | |
- case 'a': | |
+ case 'A': | |
attrtimeout = atof(EARGF(usage())); | |
break; | |
+ case 'a': | |
+ aname = EARGF(usage()); | |
+ break; | |
default: | |
usage(); | |
}ARGEND | |
t@@ -93,7 +97,7 @@ threadmain(int argc, char **argv) | |
setsid(); /* won't be able to use console, but can't be interru… | |
- init9p(argv[0]); | |
+ init9p(argv[0], aname); | |
initfuse(argv[1]); | |
fusechan = chancreate(sizeof(void*), 0); | |
t@@ -122,13 +126,13 @@ fusereader(void *v) | |
} | |
void | |
-init9p(char *addr) | |
+init9p(char *addr, char *spec) | |
{ | |
int fd; | |
if((fd = dial(netmkaddr(addr, "tcp", "564"), nil, nil, nil)) < 0) | |
sysfatal("dial %s: %r", addr); | |
- if((fsys = fsmount(fd, "")) == nil) | |
+ if((fsys = fsmount(fd, spec)) == nil) | |
sysfatal("fsmount: %r"); | |
fsysroot = fsroot(fsys); | |
} |