From db7290d79e86abfdab490e793073a4936c8e1e5f Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 1 May 2011 07:07:32 +0000 Subject: cwfs: fix network listener, relay auth errors. boot(8): split bootargs only on first ! char, prepare /net so cwfs can announce 9fs --- sys/src/cmd/cwfs/net.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'sys/src/cmd/cwfs/net.c') diff --git a/sys/src/cmd/cwfs/net.c b/sys/src/cmd/cwfs/net.c index ed6abe280..e8df40302 100644 --- a/sys/src/cmd/cwfs/net.c +++ b/sys/src/cmd/cwfs/net.c @@ -54,19 +54,18 @@ neti(void *v) Network *net; net = v; - print("net%di\n", net->ctlrno); -Listen: - if((lisfd = listen(net->anndir, net->lisdir)) < 0){ - print("listen %s failed: %r\n", net->anndir); - return; - } + if(chatty) + print("net%di\n", net->ctlrno); for(;;) { + if((lisfd = listen(net->anndir, net->lisdir)) < 0){ + fprint(2, "listen %s failed: %r\n", net->anndir); + break; + } /* got new call on lisfd */ if((accfd = accept(lisfd, net->lisdir)) < 0){ - print("accept %d (from %s) failed: %r\n", - lisfd, net->lisdir); + fprint(2, "accept %d (from %s) failed: %r\n", lisfd, net->lisdir); close(lisfd); - goto Listen; + continue; } nci = getnetconninfo(net->lisdir, accfd); srvchan(accfd, nci->raddr); @@ -97,10 +96,11 @@ netinit(void) if(net->dialstr == nil) continue; if((net->annfd = announce(net->dialstr, net->anndir)) < 0){ - print("can't announce %s: %r", net->dialstr); + fprint(2, "can't announce %s: %r", net->dialstr); net->dialstr = nil; continue; } - print("netinit: announced on %s\n", net->dialstr); + if(chatty) + print("netinit: announced on %s\n", net->dialstr); } } -- cgit v1.2.3