summaryrefslogtreecommitdiff
path: root/sys/src/libplumb
diff options
context:
space:
mode:
authorBurnZeZ <brz-9dev@intma.in>2013-10-31 04:26:01 -0400
committerBurnZeZ <brz-9dev@intma.in>2013-10-31 04:26:01 -0400
commit1259fe5c38255786207588c4f708017c20b9e6ce (patch)
treef1e354d90d5c7d21522a36bc98d01fbb284a1d12 /sys/src/libplumb
parent9a1e762dcc561a5e759803593f3af3d16bad3b6a (diff)
libplumb: search for plumber only at /mnt/plumb, and don't try to mount $plumbsrv if the search fails
Diffstat (limited to 'sys/src/libplumb')
-rw-r--r--sys/src/libplumb/mesg.c31
1 files changed, 5 insertions, 26 deletions
diff --git a/sys/src/libplumb/mesg.c b/sys/src/libplumb/mesg.c
index 7b4c090fb..328604288 100644
--- a/sys/src/libplumb/mesg.c
+++ b/sys/src/libplumb/mesg.c
@@ -5,37 +5,16 @@
int
plumbopen(char *name, int omode)
{
- int fd, f;
- char *s, *plumber;
+ int fd;
char buf[128], err[ERRMAX];
if(name[0] == '/')
return open(name, omode);
-
- /* find elusive plumber */
- if(access("/mnt/plumb/send", AWRITE) >= 0)
- plumber = "/mnt/plumb";
- else if(access("/mnt/term/mnt/plumb/send", AWRITE) >= 0)
- plumber = "/mnt/term/mnt/plumb";
- else{
- /* last resort: try mounting service */
- plumber = "/mnt/plumb";
- s = getenv("plumbsrv");
- if(s == nil)
- return -1;
- f = open(s, ORDWR);
- free(s);
- if(f < 0)
- return -1;
- if(mount(f, -1, "/mnt/plumb", MREPL, "") < 0){
- close(f);
- return -1;
- }
- if(access("/mnt/plumb/send", AWRITE) < 0)
- return -1;
- }
- snprint(buf, sizeof buf, "%s/%s", plumber, name);
+ if(access("/mnt/plumb/send", AWRITE) < 0)
+ return -1;
+
+ snprint(buf, sizeof buf, "/mnt/plumb/%s", name);
fd = open(buf, omode);
if(fd >= 0)
return fd;