+ if (signal_ignored (SIGHUP)) /* <- needed to handle nohup properly */
+ sigdelset (&set, SIGHUP);
+ sigdelset (&set, SIGPIPE);
+
+ int signum;
+ do
+ 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)
+ libvlc_release (vlc);