From 711481177da708b723664b1e4dafaad8307f49d6 Mon Sep 17 00:00:00 2001 From: Pierre d'Herbemont Date: Sat, 23 Feb 2008 21:34:48 +0000 Subject: [PATCH] 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. --- src/vlc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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); -- 2.39.5