aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-07-19 14:51:50 +0200
committerMattias Andrée <maandree@kth.se>2021-07-19 14:51:50 +0200
commit996118fbd2212a7a8cbeec443463173be3e604a9 (patch)
tree0d88635aff136f36923458290ea668ecb4e181d5
parentm (diff)
downloadmongotimer-996118fbd2212a7a8cbeec443463173be3e604a9.tar.gz
mongotimer-996118fbd2212a7a8cbeec443463173be3e604a9.tar.bz2
mongotimer-996118fbd2212a7a8cbeec443463173be3e604a9.tar.xz
Exit when user presses q1.1.3
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--mongotimer.c5
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;
}
}
}