Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5206f3a

Browse filesBrowse files
sam-githubMylesBorins
authored andcommitted
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: #24810 Reviewed-By: Richard Lau <riclau@uk.ibm.com>
1 parent 94d02ca commit 5206f3a
Copy full SHA for 5206f3a

File tree

Expand file treeCollapse file tree

2 files changed

+6
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-2
lines changed
Open diff view settings
Collapse file

‎src/inspector_agent.cc‎

Copy file name to clipboardExpand all lines: src/inspector_agent.cc
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ static int StartDebugSignalHandler() {
110110
sigset_t sigmask;
111111
// Mask all signals.
112112
sigfillset(&sigmask);
113-
CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, &sigmask));
113+
sigset_t savemask;
114+
CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, &savemask));
115+
sigmask = savemask;
114116
pthread_t thread;
115117
const int err = pthread_create(&thread, &attr,
116118
StartIoThreadMain, nullptr);
Collapse file

‎src/node_watchdog.cc‎

Copy file name to clipboardExpand all lines: src/node_watchdog.cc
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,9 @@ int SigintWatchdogHelper::Start() {
187187

188188
sigset_t sigmask;
189189
sigfillset(&sigmask);
190-
CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, &sigmask));
190+
sigset_t savemask;
191+
CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, &savemask));
192+
sigmask = savemask;
191193
int ret = pthread_create(&thread_, nullptr, RunSigintWatchdog, nullptr);
192194
CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, nullptr));
193195
if (ret != 0) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.