plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

commit 9f95eb6fd6e5fa8a3be78f8b1b85310f50e49380
parent 16ea7713b5a20cfb8482d4a65f40760cc67c999b
Author: rsc <devnull@localhost>
Date:   Mon, 18 Jul 2005 00:05:41 +0000

announce to networks

Diffstat:
Msrc/lib9/post9p.c | 13++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/lib9/post9p.c b/src/lib9/post9p.c @@ -8,11 +8,14 @@ post9pservice(int fd, char *name) char *ns, *s; Waitmsg *w; - if((ns = getns()) == nil) - return -1; - - s = smprint("unix!%s/%s", ns, name); - free(ns); + if(strchr(name, '!')) /* assume is already network address */ + s = strdup(name); + else{ + if((ns = getns()) == nil) + return -1; + s = smprint("unix!%s/%s", ns, name); + free(ns); + } if(s == nil) return -1; switch(fork()){