make -> mk
use $HOME/mnt/plumb as named pipe.
This commit is contained in:
parent
58611a1bbf
commit
b7e6f4150f
3 changed files with 22 additions and 23 deletions
|
|
@ -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)
|
|
||||||
|
|
||||||
|
|
@ -4,28 +4,36 @@
|
||||||
|
|
||||||
static char attrbuf[4096];
|
static char attrbuf[4096];
|
||||||
|
|
||||||
|
char *home;
|
||||||
|
|
||||||
int
|
int
|
||||||
plumbopen(char *name, int omode)
|
plumbopen(char *name, int omode)
|
||||||
{
|
{
|
||||||
int fd, f;
|
int fd, f;
|
||||||
char *s;
|
char *s;
|
||||||
char buf[128];
|
char buf[256];
|
||||||
|
|
||||||
if(name[0] == '/')
|
if(name[0] == '/')
|
||||||
return open(name, omode);
|
return open(name, omode);
|
||||||
snprint(buf, sizeof buf, "/mnt/plumb/%s", name);
|
if(home == nil){
|
||||||
fd = open(buf, omode);
|
home = getenv("HOME");
|
||||||
|
if(home == nil)
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
snprint(buf, sizeof buf, "%s/mnt/plumb", home);
|
||||||
|
/* fd = open(buf, omode);
|
||||||
if(fd >= 0)
|
if(fd >= 0)
|
||||||
return fd;
|
return fd;
|
||||||
snprint(buf, sizeof buf, "/mnt/term/mnt/plumb/%s", name);
|
snprint(buf, sizeof buf, "/mnt/term/mnt/plumb/%s", name);
|
||||||
fd = open(buf, omode);
|
fd = open(buf, omode);
|
||||||
if(fd >= 0)
|
if(fd >= 0)
|
||||||
return fd;
|
return fd;
|
||||||
/* try mounting service */
|
/* try mounting service * /
|
||||||
s = getenv("plumbsrv");
|
s = getenv("plumbsrv");
|
||||||
if(s == nil)
|
if(s == nil)
|
||||||
return -1;
|
return -1;
|
||||||
snprint(buf, sizeof buf, "/mnt/plumb/%s", name);
|
snprint(buf, sizeof buf, "/mnt/plumb/%s", name);
|
||||||
|
*/
|
||||||
return open(buf, omode);
|
return open(buf, omode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
10
src/libplumb/mkfile
Executable file
10
src/libplumb/mkfile
Executable file
|
|
@ -0,0 +1,10 @@
|
||||||
|
</$objtype/mkfile
|
||||||
|
|
||||||
|
LIB=/$objtype/lib/libplumb.a
|
||||||
|
OFILES=\
|
||||||
|
event.$O\
|
||||||
|
mesg.$O\
|
||||||
|
|
||||||
|
HFILES=/sys/include/plumb.h
|
||||||
|
|
||||||
|
</sys/src/cmd/mksyslib
|
||||||
Loading…
Add table
Add a link
Reference in a new issue