chg: forward user-defined signals
SIGUSR1 and SIGUSR2 are reserved for user-defined behaviors. They may be
redefined by an hg extension [1], but cannot be easily redefined for chg.
Since the default behavior (kill) is not that useful for chg, let's forward
them to hg, hoping it got redefined there and could be more useful.
[1] https://bitbucket.org/facebook/hg-experimental/commits/
e7c883a465
--- a/contrib/chg/procutil.c Wed Mar 08 13:34:25 2017 -0800
+++ b/contrib/chg/procutil.c Wed Mar 08 13:46:26 2017 -0800
@@ -115,6 +115,11 @@
sa.sa_flags = SA_RESTART;
if (sigaction(SIGWINCH, &sa, NULL) < 0)
goto error;
+ /* forward user-defined signals */
+ if (sigaction(SIGUSR1, &sa, NULL) < 0)
+ goto error;
+ if (sigaction(SIGUSR2, &sa, NULL) < 0)
+ goto error;
/* propagate job control requests to worker */
sa.sa_handler = forwardsignal;
sa.sa_flags = SA_RESTART;