Handle SIGINT gracefully.
authorGuus Sliepen <guus@tinc-vpn.org>
Thu, 17 Jan 2013 13:14:17 +0000 (14:14 +0100)
committerGuus Sliepen <guus@tinc-vpn.org>
Thu, 17 Jan 2013 13:14:17 +0000 (14:14 +0100)
src/net.c

index fe272db8c4f26639335edeca495ddbdb451466f5..343ac71767040cdc9083aedabe7a102d4b59c5a6 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -451,11 +451,13 @@ int main_loop(void) {
        signal_t sighup = {0};
        signal_t sigterm = {0};
        signal_t sigquit = {0};
+       signal_t sigint = {0};
        signal_t sigalrm = {0};
 
        signal_add(&sighup, sighup_handler, &sighup, SIGHUP);
        signal_add(&sigterm, sigterm_handler, &sigterm, SIGTERM);
        signal_add(&sigquit, sigterm_handler, &sigquit, SIGQUIT);
+       signal_add(&sigint, sigterm_handler, &sigint, SIGINT);
        signal_add(&sigalrm, sigalrm_handler, &sigalrm, SIGALRM);
 #endif