- /* Acknowledge the signal received */
- VLC_Die( 0 );
- }
- else if( time( NULL ) > abort_time + 2 )
- {
- /* If user asks again 1 or 2 seconds later, die badly */
- signal( SIGINT, SIG_DFL );
- signal( SIGHUP, SIG_DFL );
- signal( SIGQUIT, SIG_DFL );
- signal( SIGALRM, SIG_DFL );
- signal( SIGPIPE, SIG_DFL );
+ /* Once a signal has been trapped, the termination sequence will be
+ * armed and subsequent signals will be ignored to avoid sending
+ * signals to a libvlc structure having been destroyed */
+
+ pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
+ if (abort_time == 0)
+ {
+ time (&abort_time);
+ abort_time += 2;