mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
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:
parent
a9a5956576
commit
c49d87e113
@ -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);
|
||||||
|
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user