From 32f69c36e0eec1227934bbd34854bfebd88686f2 Mon Sep 17 00:00:00 2001 From: rsc Date: Thu, 11 Dec 2003 17:48:38 +0000 Subject: Add support for user-level 9P servers/clients and various bug fixes to go with them. --- src/libplumb/mesg.c | 36 +++++++++--------------------------- 1 file changed, 9 insertions(+), 27 deletions(-) (limited to 'src/libplumb') 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 #include +#include +#include #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 -- cgit v1.2.3