]> git.sesse.net Git - vlc/commitdiff
Handle EINTR from sigwait
authorRémi Denis-Courmont <remi@remlab.net>
Sat, 11 Jul 2009 14:22:16 +0000 (17:22 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sat, 11 Jul 2009 14:22:16 +0000 (17:22 +0300)
modules/control/signals.c

index 7b63cbc496453dcb995375dfae665b6925da03fb..1435cd3a08d1d8cec6891eeb677936e73e97a0df 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <signal.h>
 #include <time.h>
+#include <assert.h>
 
 #include <vlc_common.h>
 #include <vlc_plugin.h>
@@ -100,8 +101,15 @@ static void *SigThread (void *data)
 
     do
     {
-        sigwait (&set, &signum);
-
+        switch (sigwait (&set, &signum))
+        {
+            case EINTR:
+                continue;
+            case 0:
+                break;
+            default:
+                assert (0);
+        }
 #ifdef __APPLE__
         /* In Mac OS X up to 10.5 sigwait (among others) is not a pthread
          * cancellation point */