# | Line 463 | Line 463 | int code; | |
---|---|---|
463 | ||
464 | #else | |
465 | ||
466 | – | #include <signal.h> |
467 | – | |
466 | quit(code) /* exit gracefully */ | |
467 | int code; | |
468 | { | |
469 | int status; | |
470 | < | |
471 | < | if (code) { /* abnormal exit -- kill children */ |
472 | < | signal(SIGPIPE, SIG_IGN); |
473 | < | kill(0, SIGPIPE); |
474 | < | } |
477 | < | /* reap any children */ |
470 | > | register int i; |
471 | > | /* close input files */ |
472 | > | for (i = 0; i < nfiles; i++) |
473 | > | fclose(input[i].fp); |
474 | > | /* reap children */ |
475 | while (wait(&status) != -1) | |
476 | if (code == 0) | |
477 | code = status>>8 & 0xff; |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |