Skip to content

Commit

Permalink
Just enable hack on macOS
Browse files Browse the repository at this point in the history
This is not needed on linux at all! Tried to explain as much as I
understand with the problem.
  • Loading branch information
matthewbauer committed Jun 6, 2019
1 parent 4a3e962 commit 9b78766
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/libmain/shared.cc
Expand Up @@ -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");
#ifdef __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();
Expand Down

0 comments on commit 9b78766

Please sign in to comment.