-/*****************************************************************************
- * SimpleSignalHandler: system signal handler
- *****************************************************************************
- * This function is called when a non fatal signal is received by the program.
- *****************************************************************************/
-static void SimpleSignalHandler( int i_signal )
-{
- int i_index;
-
- /* Acknowledge the signal received and warn all the p_vlc structures */
- vlc_mutex_lock( &global_lock );
- for( i_index = 0 ; i_index < i_vlc ; i_index++ )
- {
- msg_Warn( pp_vlc[ i_index ], "ignoring signal %d", i_signal );
- }
- vlc_mutex_unlock( &global_lock );
-}
-
-/*****************************************************************************
- * FatalSignalHandler: system signal handler
- *****************************************************************************
- * This function is called when a fatal signal is received by the program.
- * It tries to end the program in a clean way.
- *****************************************************************************/
-static void FatalSignalHandler( int i_signal )
-{
- static mtime_t abort_time = 0;
- static volatile vlc_bool_t b_die = 0;
- int i_index;
-
- /* Once a signal has been trapped, the termination sequence will be
- * armed and following signals will be ignored to avoid sending messages
- * to an interface having been destroyed */
-
- vlc_mutex_lock( &global_lock );
- if( !b_die )
- {
- b_die = 1;
- abort_time = mdate();
-
- /* Try to terminate everything - this is done by requesting the end of
- * all the p_vlc structures */
- for( i_index = 0 ; i_index < i_vlc ; i_index++ )
- {
- /* Acknowledge the signal received */
- msg_Err( pp_vlc[ i_index ], "signal %d received, exiting - do it "
- "again in case vlc gets stuck", i_signal );
- pp_vlc[ i_index ]->b_die = 1;
- }
- }
- else if( mdate() > abort_time + 1000000 )
- {
- /* If user asks again 1 second later, die badly */