summaryrefslogtreecommitdiff
path: root/src/node_watchdog.cc
diff options
context:
space:
mode:
authorSam Roberts <vieuxtech@gmail.com>2018-12-03 09:09:59 -0800
committerSam Roberts <vieuxtech@gmail.com>2018-12-07 10:13:51 -0800
commitc49d87e1131f31edb4ea9b9a1ab08eadae4dfc61 (patch)
treed387a0dc640592f8127dc25b6fe02facc4f2cde1 /src/node_watchdog.cc
parenta9a595657651cd5c66a1d0ee8749ace8fb6b51c3 (diff)
downloadandroid-node-v8-c49d87e1131f31edb4ea9b9a1ab08eadae4dfc61.tar.gz
android-node-v8-c49d87e1131f31edb4ea9b9a1ab08eadae4dfc61.tar.bz2
android-node-v8-c49d87e1131f31edb4ea9b9a1ab08eadae4dfc61.zip
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>
Diffstat (limited to 'src/node_watchdog.cc')
-rw-r--r--src/node_watchdog.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/node_watchdog.cc b/src/node_watchdog.cc
index b8665dc1be..9ef7bafede 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) {