[vlc-devel] commit: Handle EINTR from sigwait ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat Jul 11 16:22:58 CEST 2009


vlc | branch: 1.0-bugfix | Rémi Denis-Courmont <remi at remlab.net> | Sat Jul 11 17:22:16 2009 +0300| [292a59e277690465141cd432fa565ea8276f8729] | committer: Rémi Denis-Courmont 

Handle EINTR from sigwait
(cherry picked from commit 5878fd3087cc631b930e4c486612af92a2ba9c68)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=292a59e277690465141cd432fa565ea8276f8729
---

 modules/control/signals.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/modules/control/signals.c b/modules/control/signals.c
index 7b63cbc..1435cd3 100644
--- a/modules/control/signals.c
+++ b/modules/control/signals.c
@@ -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 */




More information about the vlc-devel mailing list