Fix clone_exit_signal test

This commit is contained in:
Ruihan Li
2024-10-31 11:15:50 +08:00
committed by Tate, Hongliang Tian
parent 768b182aba
commit 19b13d88e2
2 changed files with 5 additions and 1 deletions

View File

@ -21,6 +21,9 @@ bitflags! {
const WEXITED = 0x4;
const WCONTINUED = 0x8;
const WNOWAIT = 0x01000000;
const WNOTHREAD = 0x20000000;
const WALL = 0x40000000;
const WCLONE = 0x80000000;
}
}

View File

@ -46,7 +46,8 @@ int main(int argc, char *argv[])
* then the parent process must specify the __WALL or __WCLONE
* options when waiting for the child with wait(2).
*/
waitpid(pid, NULL, __WALL);
if (waitpid(pid, NULL, __WALL) < 0)
err(EXIT_FAILURE, "cannot wait child process");
if (child_exit_recv != 1)
errx(EXIT_FAILURE, "did not receive exit signal from child");