diff options
author | rsc <devnull@localhost> | 2004-03-05 05:53:11 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2004-03-05 05:53:11 +0000 |
commit | 15680d56a6c6e15921d958aa6006825c2cd20bf8 (patch) | |
tree | 84abb4cb8d761fb49d688b3eebcf17e47f05372a /src/cmd | |
parent | 230d62c4756ece47951e96a7cb1b5b72cf6a3844 (diff) | |
download | plan9port-15680d56a6c6e15921d958aa6006825c2cd20bf8.tar.gz plan9port-15680d56a6c6e15921d958aa6006825c2cd20bf8.tar.bz2 plan9port-15680d56a6c6e15921d958aa6006825c2cd20bf8.zip |
Amazingly picky bug fixes from Valgrind.
Diffstat (limited to 'src/cmd')
-rw-r--r-- | src/cmd/acme/util.c | 4 | ||||
-rw-r--r-- | src/cmd/plumb/plumber.c | 7 | ||||
-rw-r--r-- | src/cmd/plumb/rules.c | 1 |
3 files changed, 9 insertions, 3 deletions
diff --git a/src/cmd/acme/util.c b/src/cmd/acme/util.c index 180b2bd2..cfbfae3f 100644 --- a/src/cmd/acme/util.c +++ b/src/cmd/acme/util.c @@ -298,7 +298,7 @@ tgetc(void *a, uint n) Rune* skipbl(Rune *r, int n, int *np) { - while(n>0 && *r==' ' || *r=='\t' || *r=='\n'){ + while(n>0 && (*r==' ' || *r=='\t' || *r=='\n')){ --n; r++; } @@ -309,7 +309,7 @@ skipbl(Rune *r, int n, int *np) Rune* findbl(Rune *r, int n, int *np) { - while(n>0 && *r!=' ' && *r!='\t' && *r!='\n'){ + while(n>0 && (*r!=' ' && *r!='\t' && *r!='\n')){ --n; r++; } 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; } |