CPU: force the SIGILL handler back to default after forking
authorRémi Denis-Courmont <remi@remlab.net>
Tue, 12 Jan 2010 21:28:47 +0000 (23:28 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Tue, 12 Jan 2010 21:28:47 +0000 (23:28 +0200)
In case the LibVLC application has overriden SIGILL, we really want to
crash rather than run the handler.

src/misc/cpu.c

index 777b13a..b1ff295 100644 (file)
@@ -37,6 +37,7 @@
 #ifndef WIN32
 #include <unistd.h>
 #include <sys/wait.h>
+#include <signal.h>
 #else
 #include <errno.h>
 #endif
@@ -120,8 +121,9 @@ uint32_t CPUCapabilities( void )
         pid_t pid = fork();                    \
         if( pid == 0 )                         \
         {                                      \
+            signal(SIGILL, SIG_DFL);           \
             __asm__ __volatile__ ( code : : ); \
-            _exit(0);                           \
+            _exit(0);                          \
         }                                      \
         if( check_OS_capability((name), pid )) \
             i_capabilities |= (flag);          \