changeset 31230:cc37b5a06e32

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
author Jun Wu <quark@fb.com>
date Wed, 08 Mar 2017 13:46:26 -0800
parents 68c94f286e25
children 0a38a313033e
files contrib/chg/procutil.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;