diff options
-rw-r--r-- | level06.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -11,17 +11,15 @@ int testfragment(const char *str) { int out[2]; pipe2(out, O_NONBLOCK); - if (fork()) { int status; close(out[1]); - wait(NULL); - while (getpgid(getpid() + 2) == getpid()) + status = wait(NULL); + while (getpgid(status + 1) == getpid()) usleep(100); status = read(out[0], NULL, 1); close(out[0]); return status == 0; - } else { int file; struct rlimit limit; |