]> git.sesse.net Git - vlc/blobdiff - src/vlc.c
Code factorization: use input_ItemAddOption
[vlc] / src / vlc.c
index e934b88dd705308e02bb5cda367167b6bb953b69..b8dd9bb9586876aa049143363252c0f4a79ae8da 100644 (file)
--- a/src/vlc.c
+++ b/src/vlc.c
@@ -95,6 +95,9 @@ int main( int i_argc, const char *ppsz_argv[] )
 #   ifdef DEBUG
     /* Activate malloc checking routines to detect heap corruptions. */
     putenv( (char*)"MALLOC_CHECK_=2" );
+#       ifdef __APPLE__
+    putenv( (char*)"MallocErrorAbort=crash_my_baby_crash" );
+#       endif
 
     /* Disable the ugly Gnome crash dialog so that we properly segfault */
     putenv( (char *)"GNOME_DISABLE_CRASH_DIALOG=1" );
@@ -274,19 +277,18 @@ static void *SigHandler (void *data)
          * signals to a libvlc structure having been destroyed */
 
         pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
-        if (abort_time == 0)
+        if (abort_time == 0 || time (NULL) > abort_time)
         {
             time (&abort_time);
             abort_time += 2;
 
             fprintf (stderr, "signal %d received, terminating vlc - do it "
-                            "again in case it gets stuck\n", i_signal);
+                            "again quickly in case it gets stuck\n", i_signal);
 
             /* Acknowledge the signal received */
             Kill ();
         }
-        else
-        if (time (NULL) <= abort_time)
+        else /* time (NULL) <= abort_time */
         {
             /* If user asks again more than 2 seconds later, die badly */
             pthread_sigmask (SIG_UNBLOCK, exitset, NULL);