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: https://github.com/nodejs/node/pull/24810
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
This commit is contained in:
Sam Roberts 2018-12-03 09:09:59 -08:00
parent a9a5956576
commit c49d87e113
2 changed files with 6 additions and 2 deletions

View File

@ -110,7 +110,9 @@ static int StartDebugSignalHandler() {
sigset_t sigmask; sigset_t sigmask;
// Mask all signals. // Mask all signals.
sigfillset(&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;
pthread_t thread; pthread_t thread;
const int err = pthread_create(&thread, &attr, const int err = pthread_create(&thread, &attr,
StartIoThreadMain, nullptr); StartIoThreadMain, nullptr);

View File

@ -187,7 +187,9 @@ int SigintWatchdogHelper::Start() {
sigset_t sigmask; sigset_t sigmask;
sigfillset(&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); int ret = pthread_create(&thread_, nullptr, RunSigintWatchdog, nullptr);
CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, nullptr)); CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, nullptr));
if (ret != 0) { if (ret != 0) {