]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Use sigprocmask(SIG_SETMASK) to make sure the signal mask is in a
authorTom Hughes <tom@compton.nu>
Tue, 16 Nov 2004 12:09:43 +0000 (12:09 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 16 Nov 2004 12:09:43 +0000 (12:09 +0000)
known state before performing the test. This is done because perl on
some systems leaves some signals blocked when starting child
processes which can cause this test to fail.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3021

memcheck/tests/sigprocmask.c

index dc00102ed25c434d1ee3b35f69820468680ac22c..2817901b6c8bc734d2733deccea0c6ab39e61d2a 100644 (file)
@@ -21,6 +21,12 @@ int main(void)
    s  = &x[1];
    os = &x[4];
 
+   // Make sure the system is in a known state with no signals
+   // blocked as perl has been known to leave some signals blocked
+   // when starting child processes which can cause failures in
+   // this test unless we reset things here.
+   syscall(__NR_sigprocmask, SIG_SETMASK, os, NULL);
+
    fprintf(stderr, "before\n");
    for (i = 0; i < 6; i++) {
       fprintf(stderr, "%x ", x[i]);