Skip to content
Permalink
Browse files

src: do not alias new and old signal masks

In recent gcc, -Wrestrict warns when an argument passed to a
restrict-qualified parameter aliases with another argument.

PR-URL: #24810
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
  • Loading branch information...
sam-github authored and BethGriggs committed Dec 3, 2018
1 parent f0e7b2f commit 16a1f96d6e573c8f921c3eb54b0c87bcb6129243
Showing with 6 additions and 2 deletions.
  1. +3 −1 src/inspector_agent.cc
  2. +3 −1 src/node_watchdog.cc
@@ -109,7 +109,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);
@@ -186,7 +186,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) {

0 comments on commit 16a1f96

Please sign in to comment.
You can’t perform that action at this time.