test/msan/sigwait: Don't silently ignore assertion failures

Summary: As the parent process would return 0 independent of whether the child succeeded, assertions in the child would be ignored.

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: #sanitizers

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D82400
This commit is contained in:
Gui Andrade 2020-06-23 14:10:31 -07:00 committed by Evgenii Stepanov
parent f64dc4e686
commit 16784c0558

View File

@ -4,6 +4,7 @@
#include <assert.h>
#include <signal.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <unistd.h>
#include <sanitizer/msan_interface.h>
@ -19,7 +20,9 @@ void test_sigwait() {
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);