# HG changeset patch # User Jun Wu # Date 2017-03-08 21:46:26 # Node ID cc37b5a06e3258908b435956c6fffd7d80128014 # Parent 68c94f286e2574e6f5ebc1e72acb3e2929db94aa 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 diff --git a/contrib/chg/procutil.c b/contrib/chg/procutil.c --- a/contrib/chg/procutil.c +++ b/contrib/chg/procutil.c @@ -115,6 +115,11 @@ void setupsignalhandler(pid_t pid, pid_t 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;