about summary refs log tree commit diff
path: root/src/libmain
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2019-06-06T00·18-0400
committerMatthew Bauer <mjbauer95@gmail.com>2019-06-06T00·20-0400
commit5011a52cf3f291c22d784aff6f5bbf8b99ae186a (patch)
treea2a4e1da2dfce2a224abb79ac1e7b7106f5a3572 /src/libmain
parent4a3e96281d6b9ae3dbc20e638f389677df9a649e (diff)
Just enable hack on macOS
This is not needed on linux at all! Tried to explain as much as I
understand with the problem.
Diffstat (limited to 'src/libmain')
-rw-r--r--src/libmain/shared.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc
index f2aeec9e1db5..a6101342ac7a 100644
--- a/src/libmain/shared.cc
+++ b/src/libmain/shared.cc
@@ -125,8 +125,14 @@ 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");
+#if __APPLE__
+    /* HACK: on darwin, we need can’t use sigprocmask with SIGWINCH.
+     * Instead, add a dummy sigaction handler, and signalHandlerThread
+     * can handle the rest. */
+    struct sigaction sa;
+    sa.sa_handler = sigHandler;
+    if (sigaction(SIGWINCH, &sa, 0)) throw SysError("handling SIGWINCH");
+#endif
 
     /* Register a SIGSEGV handler to detect stack overflows. */
     detectStackOverflow();