diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc index 5e53201c42d5c2..21319abca7d1f5 100644 --- a/src/inspector_agent.cc +++ b/src/inspector_agent.cc @@ -110,7 +110,9 @@ static int StartDebugSignalHandler() { sigset_t sigmask; // Mask all signals. sigfillset(&sigmask); - CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, &sigmask)); + sigset_t savemask; + CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, &savemask)); + sigmask = savemask; pthread_t thread; const int err = pthread_create(&thread, &attr, StartIoThreadMain, nullptr); diff --git a/src/node_watchdog.cc b/src/node_watchdog.cc index b8665dc1be225d..9ef7bafeded44f 100644 --- a/src/node_watchdog.cc +++ b/src/node_watchdog.cc @@ -187,7 +187,9 @@ int SigintWatchdogHelper::Start() { sigset_t sigmask; sigfillset(&sigmask); - CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, &sigmask)); + sigset_t savemask; + CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, &savemask)); + sigmask = savemask; int ret = pthread_create(&thread_, nullptr, RunSigintWatchdog, nullptr); CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, nullptr)); if (ret != 0) {