chg: forward SIGWINCH to worker stable
authorJun Wu <quark@fb.com>
Sun, 10 Apr 2016 01:28:52 +0100
branchstable
changeset 28980 b89e4457fa86
parent 28979 e442b628bfe6
child 28981 7b188bc23942
chg: forward SIGWINCH to worker Before this patch, if the user uses chg and ncurses interface, resizing the terminal window will mess up its content. This patch fixes the issue by forwarding SIGWINCH to the worker process.
contrib/chg/chg.c
--- a/contrib/chg/chg.c	Sat Apr 16 18:09:42 2016 -0500
+++ b/contrib/chg/chg.c	Sun Apr 10 01:28:52 2016 +0100
@@ -397,6 +397,10 @@
 	if (sigaction(SIGTERM, &sa, NULL) < 0)
 		goto error;
 
+	/* notify the worker about window resize events */
+	sa.sa_flags = SA_RESTART;
+	if (sigaction(SIGWINCH, &sa, NULL) < 0)
+		goto error;
 	/* propagate job control requests to worker */
 	sa.sa_handler = forwardsignal;
 	sa.sa_flags = SA_RESTART;