@@ 23,6 23,7 @@ static void
pexec(void *args)
{
Exec *e = args;
+ int fd;
if(e->p[0] >= 0){
dup(e->p[Them], 0);
@@ 33,8 34,10 @@ pexec(void *args)
close(0);
close(1);
}
- if(debug < 1)
- close(2);
+ if(debug < 1){
+ dup(fd = open("/dev/null", OWRITE), 2);
+ close(fd);
+ }
procexec(e->pid, e->file, e->argv);
}