From 16126708a9b836b39d689211f6b1952abe72c3ae Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 12 Sep 2015 03:30:54 +0200 Subject: signals will interrupt read on timer, so we do not have to wait for the timer to expire to exit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mongoclock.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') 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) { -- cgit v1.2.3-70-g09d2