-#if defined(UNDER_CE)
-# if defined( _MSC_VER ) && defined( UNDER_CE )
-# include "vlc_common.h"
-# endif
-/*****************************************************************************
- * WinMain: parse command line, start interface and spawn threads. (WinCE only)
- *****************************************************************************/
-int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
- LPTSTR lpCmdLine, int nCmdShow )
-{
- char **argv, psz_cmdline[MAX_PATH];
- int argc, i_ret;
-
- WideCharToMultiByte( CP_ACP, 0, lpCmdLine, -1,
- psz_cmdline, MAX_PATH, NULL, NULL );
-
- argv = vlc_parse_cmdline( psz_cmdline, &argc );
- argv = realloc( argv, (argc + 1) * sizeof(char *) );
- if( !argv ) return -1;
-
- if( argc ) memmove( argv + 1, argv, argc * sizeof(char *) );
- argv[0] = ""; /* Fake program path */
-
- i_ret = main( argc + 1, argv );
-
- /* No need to free the argv memory */
- return i_ret;
-}
+ if (!sigismember (exitset, i_signal))
+ continue; /* Ignore "dummy" signals */
+
+ /* 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 (NULL) > abort_time)
+ {
+ time (&abort_time);
+ abort_time += 2;
+
+ fprintf (stderr, "signal %d received, terminating vlc - do it "
+ "again quickly in case it gets stuck\n", i_signal);
+ //VLC_Die( 0 );
+ }
+ else /* time (NULL) <= abort_time */
+ {
+ /* If user asks again more than 2 seconds later, die badly */
+ pthread_sigmask (SIG_UNBLOCK, exitset, NULL);
+ fprintf (stderr, "user insisted too much, dying badly\n");
+#ifdef __APPLE__
+ /* On Mac OS X, use exit(-1) as it doesn't trigger
+ * backtrace generation, whereas abort() does.
+ * The backtrace generation trigger a Crash Dialog
+ * And takes way too much time, which is not what
+ * we want. */
+ exit (-1);
+#else
+ abort ();