Skip to content

Commit

Permalink
sigchain: add command to pop all common signals
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stefan Beller authored and Junio C Hamano committed Dec 16, 2015
1 parent b4e04fb commit bfb6b53
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sigchain.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
1 change: 1 addition & 0 deletions sigchain.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit bfb6b53

Please sign in to comment.