diff --git a/compiler-rt/test/msan/sigwait.cpp b/compiler-rt/test/msan/sigwait.cpp --- a/compiler-rt/test/msan/sigwait.cpp +++ b/compiler-rt/test/msan/sigwait.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -19,7 +20,9 @@ if (pid_t pid = fork()) { kill(pid, SIGUSR1); - _exit(0); + int child_stat; + wait(&child_stat); + _exit(!WIFEXITED(child_stat)); } else { int sig; int res = sigwait(&s, &sig);