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 a408ba6

Browse filesBrowse files
Stewart X AddisonItalo A. Casas
authored andcommitted
build: don't squash signal handlers with --shared
An application using node built as a shared library may legitimately implement its own signal handling routines. Current behaviour is to squash all signal handlers on node startup. This change will stop that behaviour when node is built as a shared library. PR-URL: #10539 Fixes: #10520 Refs: #615 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent 4e7a31b commit a408ba6
Copy full SHA for a408ba6

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Open diff view settings
Collapse file

‎src/node.cc‎

Copy file name to clipboardExpand all lines: src/node.cc
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2198,7 +2198,7 @@ static void WaitForInspectorDisconnect(Environment* env) {
21982198
if (env->inspector_agent()->IsConnected()) {
21992199
// Restore signal dispositions, the app is done and is no longer
22002200
// capable of handling signals.
2201-
#ifdef __POSIX__
2201+
#if defined(__POSIX__) && !defined(NODE_SHARED_MODE)
22022202
struct sigaction act;
22032203
memset(&act, 0, sizeof(act));
22042204
for (unsigned nr = 1; nr < kMaxSignal; nr += 1) {
@@ -4166,6 +4166,7 @@ inline void PlatformInit() {
41664166

41674167
CHECK_EQ(err, 0);
41684168

4169+
#ifndef NODE_SHARED_MODE
41694170
// Restore signal dispositions, the parent process may have changed them.
41704171
struct sigaction act;
41714172
memset(&act, 0, sizeof(act));
@@ -4179,6 +4180,7 @@ inline void PlatformInit() {
41794180
act.sa_handler = (nr == SIGPIPE) ? SIG_IGN : SIG_DFL;
41804181
CHECK_EQ(0, sigaction(nr, &act, nullptr));
41814182
}
4183+
#endif // !NODE_SHARED_MODE
41824184

41834185
RegisterSignalHandler(SIGINT, SignalExit, true);
41844186
RegisterSignalHandler(SIGTERM, SignalExit, true);

0 commit comments

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