Skip to content

Commit

Permalink
src: do not alias new and old signal masks
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
sam-github authored and MylesBorins committed Dec 7, 2018
1 parent 94d02ca commit 5206f3a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/inspector_agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion src/node_watchdog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5206f3a

Please sign in to comment.