pthread_kill (*ps, SIGTERM);
}
+static void exit_timeout (int signum)
+{
+ (void) signum;
+ signal (SIGINT, SIG_DFL);
+}
/*****************************************************************************
* main: parse command line, start interface and spawn threads.
if (vlc == NULL)
goto out;
- libvlc_set_user_agent (vlc, "VLC media player", NULL);
+ libvlc_set_user_agent (vlc, "VLC media player", NULL);
#if !defined (HAVE_MAEMO) && !defined __APPLE__
libvlc_add_intf (vlc, "globalhotkeys,none");
sigwait (&set, &signum);
while (signum == SIGCHLD);
+ /* Restore default signal behaviour after 3 seconds */
+ sigemptyset (&set);
+ sigaddset (&set, SIGINT);
+ sigaddset (&set, SIGALRM);
+ signal (SIGINT, SIG_IGN);
+ signal (SIGALRM, exit_timeout);
+ pthread_sigmask (SIG_UNBLOCK, &set, NULL);
+ alarm (3);
+
/* Cleanup */
out:
if (vlc != NULL)