From 15680d56a6c6e15921d958aa6006825c2cd20bf8 Mon Sep 17 00:00:00 2001 From: rsc Date: Fri, 5 Mar 2004 05:53:11 +0000 Subject: Amazingly picky bug fixes from Valgrind. --- src/cmd/plumb/plumber.c | 7 ++++++- src/cmd/plumb/rules.c | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src/cmd/plumb') diff --git a/src/cmd/plumb/plumber.c b/src/cmd/plumb/plumber.c index ae45f933..54c60521 100644 --- a/src/cmd/plumb/plumber.c +++ b/src/cmd/plumb/plumber.c @@ -29,14 +29,18 @@ void threadmain(int argc, char *argv[]) { char buf[512]; - int fd; + int fd, dofork; progname = "plumber"; + dofork = 1; ARGBEGIN{ case 'd': debug = 1; break; + case 'f': + dofork = 0; + break; case 'p': plumbfile = ARGF(); break; @@ -66,6 +70,7 @@ threadmain(int argc, char *argv[]) * Start all processes and threads from other proc * so we (main pid) can return to user. */ + if(dofork) switch(fork()){ case -1: sysfatal("fork: %r"); diff --git a/src/cmd/plumb/rules.c b/src/cmd/plumb/rules.c index 52a3d8e5..689edf59 100644 --- a/src/cmd/plumb/rules.c +++ b/src/cmd/plumb/rules.c @@ -741,6 +741,7 @@ morerules(uchar *text, int done) ; while((rs=readruleset()) != nil){ rules = erealloc(rules, (n+2)*sizeof(Ruleset*)); + fprint(2, "initialize rules %d %d\n", n, n+1); rules[n++] = rs; rules[n] = nil; } -- cgit v1.2.3