- /* Initialize vlc */
- err = vlc_init( p_vlc, i_argc, ppsz_argv );
- if( err != VLC_SUCCESS )
+#if !defined(WIN32) && !defined(UNDER_CE)
+ /* Set the signal handlers. SIGTERM is not intercepted, because we need at
+ * least one method to kill the program when all other methods failed, and
+ * when we don't want to use SIGKILL.
+ * Note that we set the signals after the vlc_create call. */
+ signal( SIGINT, SigHandler );
+ signal( SIGHUP, SigHandler );
+ signal( SIGQUIT, SigHandler );
+
+ /* Other signals */
+ signal( SIGALRM, SIG_IGN );
+ signal( SIGPIPE, SIG_IGN );
+#endif
+
+ /* Initialize libvlc */
+ i_ret = VLC_Init( 0, i_argc, ppsz_argv );
+ if( i_ret < 0 )