diff options
author | Mattias Andrée <maandree@kth.se> | 2021-07-19 14:51:50 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-07-19 14:51:50 +0200 |
commit | 996118fbd2212a7a8cbeec443463173be3e604a9 (patch) | |
tree | 0d88635aff136f36923458290ea668ecb4e181d5 | |
parent | m (diff) | |
download | mongotimer-1.1.3.tar.gz mongotimer-1.1.3.tar.bz2 mongotimer-1.1.3.tar.xz |
Exit when user presses q1.1.3
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r-- | mongotimer.c | 5 |
1 files changed, 5 insertions, 0 deletions
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; } } } |