aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/9pfuse
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2007-06-21 02:11:21 +0000
committerrsc <devnull@localhost>2007-06-21 02:11:21 +0000
commit9ec386fef4927034303b7e477f1570c09fba527f (patch)
tree4781cd41e71d0400edc83d7e9cc2a7c1af9f8d66 /src/cmd/9pfuse
parent6654bd74cbcac31835b75cc473132c9a844073e4 (diff)
downloadplan9port-9ec386fef4927034303b7e477f1570c09fba527f.tar.gz
plan9port-9ec386fef4927034303b7e477f1570c09fba527f.tar.bz2
plan9port-9ec386fef4927034303b7e477f1570c09fba527f.zip
add -a aname
Diffstat (limited to 'src/cmd/9pfuse')
-rw-r--r--src/cmd/9pfuse/main.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/cmd/9pfuse/main.c b/src/cmd/9pfuse/main.c
index 15cbb8fb..82d7b1fe 100644
--- a/src/cmd/9pfuse/main.c
+++ b/src/cmd/9pfuse/main.c
@@ -33,6 +33,7 @@
int debug;
char *argv0;
+char *aname = "";
void fusedispatch(void*);
Channel *fusechan;
@@ -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\n");
exit(1);
}
@@ -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
@@ -93,7 +97,7 @@ threadmain(int argc, char **argv)
setsid(); /* won't be able to use console, but can't be interrupted */
- init9p(argv[0]);
+ init9p(argv[0], aname);
initfuse(argv[1]);
fusechan = chancreate(sizeof(void*), 0);
@@ -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);
}