From f063dad96ec737db0ce213c4df32ecc600637881 Mon Sep 17 00:00:00 2001 From: rsc Date: Sun, 29 Feb 2004 22:42:33 +0000 Subject: Small tweaks to make things build again. --- src/cmd/plumb/plumber.c | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) (limited to 'src/cmd/plumb/plumber.c') diff --git a/src/cmd/plumb/plumber.c b/src/cmd/plumb/plumber.c index 424469f2..ae45f933 100644 --- a/src/cmd/plumb/plumber.c +++ b/src/cmd/plumb/plumber.c @@ -25,24 +25,11 @@ makeports(Ruleset *rules[]) addport(rules[i]->port); } -void -mainproc(void *v) -{ - Channel *c; - - c = v; - printerrors = 0; - makeports(rules); - startfsys(); - sendp(c, nil); -} - void threadmain(int argc, char *argv[]) { char buf[512]; int fd; - Channel *c; progname = "plumber"; @@ -79,11 +66,18 @@ threadmain(int argc, char *argv[]) * Start all processes and threads from other proc * so we (main pid) can return to user. */ - c = chancreate(sizeof(void*), 0); - proccreate(mainproc, c, 8192); - recvp(c); - chanfree(c); - threadexits(nil); + switch(fork()){ + case -1: + sysfatal("fork: %r"); + case 0: + break; + default: + _exit(0); + } + + printerrors = 0; + makeports(rules); + startfsys(); } void -- cgit v1.2.3