]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
privops: ignore signals in helper
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 10 Dec 2015 15:10:31 +0000 (16:10 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 10 Dec 2015 15:30:31 +0000 (16:30 +0100)
If the whole process group receives a signal (e.g. CTRL-C in terminal),
the helper process needs to keep running until it gets the QUIT request,
so the system drivers can still use it in their finalisation, e.g. to
cancel remaining slew.

privops.c

index cd591e1a872d04aea313644a7608024d1ec640e5..c084ac5e2858ae1233910e896f06f896959904d7 100644 (file)
--- a/privops.c
+++ b/privops.c
@@ -520,6 +520,9 @@ PRV_StartHelper(void)
         close(fd);
     }
 
+    /* ignore signals, the process will exit on OP_QUIT request */
+    UTI_SetQuitSignalsHandler(SIG_IGN);
+
     helper_main(sock_pair[1]);
 
   } else {