aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2019-06-05 00:40:45 -0400
committerMatthew Bauer <mjbauer95@gmail.com>2019-06-05 00:40:45 -0400
commit4a3e96281d6b9ae3dbc20e638f389677df9a649e (patch)
tree27811a7870a8fe56b94f35ecb19c0d82e268deda /src
parentfb0ad898ed0f1c8d5297f5dc1035b2e6ac7e3632 (diff)
Handle SIGWINCH in main thread
For the SIGWINCH signal to be caught, it needs to be set in sigaction on the main thread. Previously, this was broken, and updateWindowSize was never being called. Tested on macOS 10.14.
Diffstat (limited to 'src')
-rw-r--r--src/libmain/shared.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc
index 4ed34e54d..f2aeec9e1 100644
--- a/src/libmain/shared.cc
+++ b/src/libmain/shared.cc
@@ -125,6 +125,9 @@ void initNix()
act.sa_handler = sigHandler;
if (sigaction(SIGUSR1, &act, 0)) throw SysError("handling SIGUSR1");
+ /* Make sure SIGWINCH is handled as well. */
+ if (sigaction(SIGWINCH, &act, 0)) throw SysError("handling SIGWINCH");
+
/* Register a SIGSEGV handler to detect stack overflows. */
detectStackOverflow();