Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
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.
  • Loading branch information
sam-github committed Dec 3, 2018
commit e55511ed660e6d259944992eb6e159ae49f40b3b
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