aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--level06.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/level06.c b/level06.c
index 7e4d9cb..1778f9c 100644
--- a/level06.c
+++ b/level06.c
@@ -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;