[vlc-devel] commit: CPU: force the SIGILL handler back to default after forking ( Rémi Denis-Courmont )

git version control git at videolan.org
Tue Jan 12 22:29:53 CET 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Jan 12 23:28:47 2010 +0200| [233b4157d6dd8d01e26dd5bf8e5fb4db91c92639] | committer: Rémi Denis-Courmont 

CPU: force the SIGILL handler back to default after forking

In case the LibVLC application has overriden SIGILL, we really want to
crash rather than run the handler.

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

 src/misc/cpu.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/misc/cpu.c b/src/misc/cpu.c
index 777b13a..b1ff295 100644
--- a/src/misc/cpu.c
+++ b/src/misc/cpu.c
@@ -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);          \




More information about the vlc-devel mailing list