Petr Salinger <petr.salin...@seznam.cz> (08/12/2009):
> It might be due to "The use of the sigprocmask() function is
> unspecified in a multi-threaded process."
> http://www.opengroup.org/onlinepubs/9699919799/functions/pthread_sigmask.html
>
> I do not have kfreebsd box handy now.
> Kibi, please, does it work with pthread_sigmask() instead of sigprocmask() ?

It indeed seems to work fine. Please find attached the new patch.

[ By the way, my original patch isn't very okay actually. __GLIBC__
gets set on Linux too, e.g. when stdio.h gets included, which is quite
common; sorry about that, and many thanks to kolter for raising this
point on IRC. ]

Mraw,
KiBi.
--- a/src/main.cc
+++ b/src/main.cc
@@ -535,7 +535,7 @@ int main(int argc, char *argv[])
 
     sigaddset(&mask, SIGWINCH);
 
-    sigprocmask(SIG_SETMASK, &mask, NULL);
+    pthread_sigmask(SIG_SETMASK, &mask, NULL);
   }
 
   srandom(time(0));

Attachment: signature.asc
Description: Digital signature

Reply via email to