# HG changeset patch # User Jun Wu # Date 1489009586 28800 # 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 -r 68c94f286e25 -r cc37b5a06e32 contrib/chg/procutil.c --- 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;