From 996118fbd2212a7a8cbeec443463173be3e604a9 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 19 Jul 2021 14:51:50 +0200 Subject: Exit when user presses q MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- mongotimer.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mongotimer.c') diff --git a/mongotimer.c b/mongotimer.c index a59e9c0..5bf9e0f 100644 --- a/mongotimer.c +++ b/mongotimer.c @@ -151,6 +151,8 @@ display_stopwatch(int timerfd) if (timerfd_settime(timerfd, 0, &old_time, NULL)) goto fail; } + } else if (c == 'q') { + goto out; } } } @@ -256,6 +258,9 @@ display_timer(int timerfd, int64_t time, int exit_on_zero) if (timerfd_settime(timerfd, 0, &old_time, NULL)) goto fail; } + } else if (c == 'q') { + caught_sigterm = 1; + goto out; } } } -- cgit v1.2.3-70-g09d2