aboutsummaryrefslogtreecommitdiff
path: root/src/libplumb
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2003-12-11 17:48:38 +0000
committerrsc <devnull@localhost>2003-12-11 17:48:38 +0000
commit32f69c36e0eec1227934bbd34854bfebd88686f2 (patch)
tree1587e9de84816b77168afa81c1594cc686809910 /src/libplumb
parentac244f8d287a6119155ea672c8fd13c487c5e4c7 (diff)
downloadplan9port-32f69c36e0eec1227934bbd34854bfebd88686f2.tar.gz
plan9port-32f69c36e0eec1227934bbd34854bfebd88686f2.tar.bz2
plan9port-32f69c36e0eec1227934bbd34854bfebd88686f2.zip
Add support for user-level 9P servers/clients and various bug fixes to go with them.
Diffstat (limited to 'src/libplumb')
-rwxr-xr-xsrc/libplumb/mesg.c36
1 files changed, 9 insertions, 27 deletions
diff --git a/src/libplumb/mesg.c b/src/libplumb/mesg.c
index 8678d753..fcade7f4 100755
--- a/src/libplumb/mesg.c
+++ b/src/libplumb/mesg.c
@@ -1,5 +1,7 @@
#include <u.h>
#include <libc.h>
+#include <fcall.h>
+#include <fs.h>
#include "plumb.h"
static char attrbuf[4096];
@@ -9,35 +11,15 @@ char *home;
int
plumbopen(char *name, int omode)
{
-#if 0
- int fd, f;
- char *s;
-#endif
- char buf[256];
+ Fsys *fs;
+ int fd;
- if(name[0] == '/')
- return open(name, omode);
- if(home == nil){
- home = getenv("HOME");
- if(home == nil)
- return -1;
- }
- snprint(buf, sizeof buf, "%s/mnt/plumb", home);
-#if 0
- fd = open(buf, omode);
- if(fd >= 0)
- return fd;
- snprint(buf, sizeof buf, "/mnt/term/mnt/plumb/%s", name);
- fd = open(buf, omode);
- if(fd >= 0)
- return fd;
- /* try mounting service */
- s = getenv("plumbsrv");
- if(s == nil)
+ fs = nsmount("plumb", "");
+ if(fs == nil)
return -1;
- snprint(buf, sizeof buf, "/mnt/plumb/%s", name);
-#endif
- return open(buf, omode);
+ fd = fsopenfd(fs, name, omode);
+ fsunmount(fs);
+ return fd;
}
static int