send output to fd instead of 0

This commit is contained in:
rsc 2005-02-11 16:42:48 +00:00
parent 5ce40ffdcf
commit 9d5979815d

View file

@ -45,7 +45,7 @@ main(int argc, char **argv)
sysfatal("fork: %r"); sysfatal("fork: %r");
case 0: case 0:
while((n = read(0, buf, sizeof buf)) > 0) while((n = read(0, buf, sizeof buf)) > 0)
if(write(0, buf, n) < 0) if(write(fd, buf, n) < 0)
break; break;
if(!waitforeof) if(!waitforeof)
postnote(PNPROC, getppid(), "kill"); postnote(PNPROC, getppid(), "kill");