]> granicus.if.org Git - python/commitdiff
faulthandler: don't use sigprocmask()
authorVictor Stinner <victor.stinner@haypocalc.com>
Tue, 19 Apr 2011 21:30:57 +0000 (23:30 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Tue, 19 Apr 2011 21:30:57 +0000 (23:30 +0200)
It has an undefined behaviour with threads, only use pthread_sigmask() if
it is available (and not broken).

Modules/faulthandler.c

index abedd5b0c256d906eea373b7d33ba0a3ec7e1f15..48c43912cecc8bf9a5cdc2d215df0075249844e8 100644 (file)
@@ -418,16 +418,12 @@ faulthandler_thread(void *unused)
     const char* errmsg;
     PyThreadState *current;
     int ok;
-#ifdef HAVE_PTHREAD_H
+#if defined(HAVE_PTHREAD_SIGMASK) && !defined(HAVE_BROKEN_PTHREAD_SIGMASK)
     sigset_t set;
 
     /* we don't want to receive any signal */
     sigfillset(&set);
-#if defined(HAVE_PTHREAD_SIGMASK) && !defined(HAVE_BROKEN_PTHREAD_SIGMASK)
     pthread_sigmask(SIG_SETMASK, &set, NULL);
-#else
-    sigprocmask(SIG_SETMASK, &set, NULL);
-#endif
 #endif
 
     do {