[PATCH] chg: forward SIGWINCH to worker

Jun Wu quark at fb.com
Sun Apr 10 00:31:23 UTC 2016


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1460248132 -3600
#      Sun Apr 10 01:28:52 2016 +0100
# Node ID a212504cf958742becab6fe518dab9b838f5bbf4
# Parent  d54a7410307fa7aef41fdc49b027a96fdf28f030
chg: forward SIGWINCH to worker

Before this patch, if the user uses chg and ncurse interface, resizing the
terminal window will mass up its content.

This patch fixes the issue by forwarding SIGWINCH to the worker process.

diff --git a/contrib/chg/chg.c b/contrib/chg/chg.c
--- a/contrib/chg/chg.c
+++ b/contrib/chg/chg.c
@@ -388,11 +388,13 @@
 	if (sigaction(SIGTERM, &sa, NULL) < 0)
 		goto error;
 
-	/* propagate job control requests to worker */
+	/* propagate important signals to worker */
 	sa.sa_handler = forwardsignal;
 	sa.sa_flags = SA_RESTART;
 	if (sigaction(SIGCONT, &sa, NULL) < 0)
 		goto error;
+	if (sigaction(SIGWINCH, &sa, NULL) < 0)
+		goto error;
 	sa.sa_handler = handlestopsignal;
 	sa.sa_flags = SA_RESTART;
 	if (sigaction(SIGTSTP, &sa, NULL) < 0)


More information about the Mercurial-devel mailing list