From b7e6f4150f0974a3f3b145a23911b7c8a4b9399b Mon Sep 17 00:00:00 2001 From: rsc Date: Sun, 23 Nov 2003 18:16:51 +0000 Subject: make -> mk use $HOME/mnt/plumb as named pipe. --- src/libplumb/Makefile | 19 ------------------- src/libplumb/mesg.c | 16 ++++++++++++---- src/libplumb/mkfile | 10 ++++++++++ 3 files changed, 22 insertions(+), 23 deletions(-) delete mode 100755 src/libplumb/Makefile create mode 100755 src/libplumb/mkfile (limited to 'src/libplumb') diff --git a/src/libplumb/Makefile b/src/libplumb/Makefile deleted file mode 100755 index e9d07a66..00000000 --- a/src/libplumb/Makefile +++ /dev/null @@ -1,19 +0,0 @@ - -LIB=../../lib/libplumb.a -OFILES=\ - mesg.o\ - -HFILES=../../include/plumb.h - -INCLUDES=-I../../include - -CFLAGS += $(INCLUDES) -D_POSIX_SOURCE - -CC=cc - -$(LIB): $(OFILES) - ar r $(LIB) $(OFILES) - -clean: - rm -rf $(TARG) $(OFILES) - diff --git a/src/libplumb/mesg.c b/src/libplumb/mesg.c index 93ab03f6..ba80ef2a 100755 --- a/src/libplumb/mesg.c +++ b/src/libplumb/mesg.c @@ -4,28 +4,36 @@ static char attrbuf[4096]; +char *home; + int plumbopen(char *name, int omode) { int fd, f; char *s; - char buf[128]; + char buf[256]; if(name[0] == '/') return open(name, omode); - snprint(buf, sizeof buf, "/mnt/plumb/%s", name); - fd = open(buf, omode); + if(home == nil){ + home = getenv("HOME"); + if(home == nil) + return -1; + } + snprint(buf, sizeof buf, "%s/mnt/plumb", home); +/* 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 */ + /* try mounting service * / s = getenv("plumbsrv"); if(s == nil) return -1; snprint(buf, sizeof buf, "/mnt/plumb/%s", name); +*/ return open(buf, omode); } diff --git a/src/libplumb/mkfile b/src/libplumb/mkfile new file mode 100755 index 00000000..a7b0b579 --- /dev/null +++ b/src/libplumb/mkfile @@ -0,0 +1,10 @@ +