aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-09-12 03:30:54 +0200
committerMattias Andrée <maandree@operamail.com>2015-09-12 03:30:54 +0200
commit16126708a9b836b39d689211f6b1952abe72c3ae (patch)
tree8fccf55a539baa9a8a455ea160a5bbb4be08efb3
parentport to c + reduce flicker + use timerfd (diff)
downloadmongoclock-16126708a9b836b39d689211f6b1952abe72c3ae.tar.gz
mongoclock-16126708a9b836b39d689211f6b1952abe72c3ae.tar.bz2
mongoclock-16126708a9b836b39d689211f6b1952abe72c3ae.tar.xz
signals will interrupt read on timer, so we do not have to wait for the timer to expire to exit
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/mongoclock.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongoclock.c b/src/mongoclock.c
index 781b7b4..8ff3676 100644
--- a/src/mongoclock.c
+++ b/src/mongoclock.c
@@ -237,6 +237,10 @@ int main(int argc, char* argv[])
signal(SIGQUIT, sigterm);
signal(SIGINT, sigterm);
signal(SIGWINCH, sigwinch);
+ siginterrupt(SIGTERM, 1);
+ siginterrupt(SIGQUIT, 1);
+ siginterrupt(SIGINT, 1);
+ siginterrupt(SIGWINCH, 1);
while (!caught_sigterm)
{