changeset 2664:1d9c5db3341d trunk

[svn] - handle sigwait(2) brokenness on linuxthreads
author nenolod
date Tue, 10 Apr 2007 08:39:56 -0700
parents 2ba01bb7e36a
children 9b08d6cc7e81
files ChangeLog src/audacious/build_stamp.c src/audacious/signals.c
diffstat 3 files changed, 25 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Apr 09 17:55:56 2007 -0700
+++ b/ChangeLog	Tue Apr 10 08:39:56 2007 -0700
@@ -1,3 +1,12 @@
+2007-04-10 00:55:56 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
+  revision [4352]
+  - unbreak the build
+  
+  trunk/src/audacious/input.h    |    1 -
+  trunk/src/audacious/playback.c |    2 --
+  2 files changed, 3 deletions(-)
+
+
 2007-04-09 20:29:20 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
   revision [4350]
   - remove the unplayable files dialog. it is more annoying than useful.
--- a/src/audacious/build_stamp.c	Mon Apr 09 17:55:56 2007 -0700
+++ b/src/audacious/build_stamp.c	Tue Apr 10 08:39:56 2007 -0700
@@ -1,2 +1,2 @@
 #include <glib.h>
-const gchar *svn_stamp = "20070409-4350";
+const gchar *svn_stamp = "20070410-4352";
--- a/src/audacious/signals.c	Mon Apr 09 17:55:56 2007 -0700
+++ b/src/audacious/signals.c	Tue Apr 10 08:39:56 2007 -0700
@@ -118,8 +118,12 @@
     return NULL; //dummy
 }
 
-void 
-signal_handlers_init (void)
+/* sets up blocking signals for pthreads. 
+ * linuxthreads sucks and needs this to make sigwait(2) work 
+ * correctly. --nenolod
+ */
+static void
+signal_initialize_blockers(void)
 {
     sigset_t blockset;
 
@@ -129,8 +133,15 @@
     sigaddset(&blockset, SIGINT);
     sigaddset(&blockset, SIGTERM);
 
-    if(pthread_sigmask(SIG_BLOCK, &blockset, NULL))
-        g_print("pthread_sigmask() failed.\n");
+    if(pthread_sigmask(SIG_SETMASK, &blockset, NULL))
+        g_print("pthread_sigmask() failed.\n");    
+}
+
+void 
+signal_handlers_init (void)
+{
+    signal_initialize_blockers();
+    pthread_atfork(NULL, NULL, signal_initialize_blockers);
 
     g_thread_create(signal_process_signals, NULL, FALSE, NULL);
 }