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

@ -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");