]> git.ipfire.org Git - thirdparty/git.git/commitdiff
sigchain: add command to pop all common signals
authorStefan Beller <sbeller@google.com>
Wed, 16 Dec 2015 00:04:09 +0000 (16:04 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 16 Dec 2015 20:06:08 +0000 (12:06 -0800)
The new method removes all common signal handlers that were installed
by sigchain_push.

CC: Jeff King <peff@peff.net>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sigchain.c
sigchain.h

index faa375d5d8e7cf6bbba599034308028efaba1e0f..2ac43bbd282492e3c35c6ac5f96b14a541ed74c6 100644 (file)
@@ -50,3 +50,12 @@ void sigchain_push_common(sigchain_fun f)
        sigchain_push(SIGQUIT, f);
        sigchain_push(SIGPIPE, f);
 }
+
+void sigchain_pop_common(void)
+{
+       sigchain_pop(SIGPIPE);
+       sigchain_pop(SIGQUIT);
+       sigchain_pop(SIGTERM);
+       sigchain_pop(SIGHUP);
+       sigchain_pop(SIGINT);
+}
index 618083bce0c66a551fd4d894b31520a67b25bac9..138b20f54b4017c1f38036935f483c628094affb 100644 (file)
@@ -7,5 +7,6 @@ int sigchain_push(int sig, sigchain_fun f);
 int sigchain_pop(int sig);
 
 void sigchain_push_common(sigchain_fun f);
+void sigchain_pop_common(void);
 
 #endif /* SIGCHAIN_H */