From b80969f6af10e1b98e075960b5d04b0051f5485c Mon Sep 17 00:00:00 2001 From: Isaac Shoebottom Date: Fri, 29 Sep 2023 17:20:10 -0300 Subject: [PATCH] Change to kill zombie procs after loop --- Assignment2/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Assignment2/main.c b/Assignment2/main.c index b86f8f4..878f58a 100644 --- a/Assignment2/main.c +++ b/Assignment2/main.c @@ -146,10 +146,9 @@ void processtree() { sprintf(num, "The value is %d\n", i); print_prompt(num); exit(0); - } else { - wait(NULL); } } + while (wait(NULL) > 0); } int main() {