diff options
author | Stefan Beller <sbeller@google.com> | 2015-12-15 16:04:09 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-12-16 12:06:08 -0800 |
commit | bfb6b53c05daedc4084a5f716804a83781826230 (patch) | |
tree | da2682061e234bbb36412ac791717cd101a89eca | |
parent | strbuf: add strbuf_read_once to read without blocking (diff) | |
download | tgif-bfb6b53c05daedc4084a5f716804a83781826230.tar.xz |
sigchain: add command to pop all common signals
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>
-rw-r--r-- | sigchain.c | 9 | ||||
-rw-r--r-- | sigchain.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/sigchain.c b/sigchain.c index faa375d5d8..2ac43bbd28 100644 --- a/sigchain.c +++ b/sigchain.c @@ -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); +} diff --git a/sigchain.h b/sigchain.h index 618083bce0..138b20f54b 100644 --- a/sigchain.h +++ b/sigchain.h @@ -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 */ |