Amazingly picky bug fixes from Valgrind.

This commit is contained in:
rsc 2004-03-05 05:53:11 +00:00
parent 230d62c475
commit 15680d56a6
9 changed files with 20 additions and 9 deletions

View file

@ -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");

View file

@ -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;
}