Files
RedBear-OS/tests/waitpid.c
T
Tibor Nagy 4381bb2a22 tests: Remove redundant return statements
When the execution reaches the end of the main functions, they implicitly return a successful status.
2019-02-20 21:09:03 +01:00

17 lines
285 B
C

#include <sys/wait.h>
#include <unistd.h>
#include <stdlib.h>
int main(void) {
pid_t pid = fork();
if (pid == 0) {
// child
sleep(1);
return EXIT_SUCCESS;
} else {
// parent
int stat_loc;
waitpid(pid, &stat_loc, 0);
}
}