From: Pierre d'Herbemont Date: Sat, 23 Feb 2008 21:34:48 +0000 (+0000) Subject: vlc.c: Attempt to kill VLC again if Ctrl-C is hit again when the abort timeout is... X-Git-Tag: 0.9.0-test0~2554 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=711481177da708b723664b1e4dafaad8307f49d6;p=vlc vlc.c: Attempt to kill VLC again if Ctrl-C is hit again when the abort timeout is ellapsed. It allows to abort VLC after the first abort timeout. --- diff --git a/src/vlc.c b/src/vlc.c index e934b88dd7..3bd21ddc9b 100644 --- a/src/vlc.c +++ b/src/vlc.c @@ -274,19 +274,18 @@ static void *SigHandler (void *data) * signals to a libvlc structure having been destroyed */ pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state); - if (abort_time == 0) + if (abort_time == 0 || time (NULL) > abort_time) { time (&abort_time); abort_time += 2; fprintf (stderr, "signal %d received, terminating vlc - do it " - "again in case it gets stuck\n", i_signal); + "again quickly in case it gets stuck\n", i_signal); /* Acknowledge the signal received */ Kill (); } - else - if (time (NULL) <= abort_time) + else /* time (NULL) <= abort_time */ { /* If user asks again more than 2 seconds later, die badly */ pthread_sigmask (SIG_UNBLOCK, exitset, NULL);