Skip to content

Commit

Permalink
replace 'waitpid' to 'wait' as requested on assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
moschiel committed Dec 14, 2024
1 parent 5e54980 commit 9367f8d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/systemcalls/systemcalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ bool do_exec(int count, ...)
} else {
// This is the parent process
// wait for the child to finish
if (waitpid(pid, &status, 0) == -1) {
//if (waitpid(pid, &status, 0) == -1) {
if (wait(&status) == -1) {
fprintf(stderr, "parent: waitpid failed");
pass = false;
} else if(WIFEXITED(status)) {
Expand Down Expand Up @@ -204,7 +205,8 @@ bool do_exec_redirect(const char *outputfile, int count, ...)
} else {
// This is the parent process
// wait for the child to finish
if (waitpid(pid, &status, 0) == -1) {
//if (waitpid(pid, &status, 0) == -1) {
if (wait(&status) == -1) {
fprintf(stderr, "parent: waitpid failed");
pass = false;
} else if(WIFEXITED(status)) {
Expand Down

0 comments on commit 9367f8d

Please sign in to comment.