Skip to content

Commit 4d6d68c

Browse files
committed
src: only block SIGUSR1 when HAVE_INSPECTOR
I'm currently seeing a timeout error for test-signal-handler.js on macosx when using the following configuration: ./configure --debug --without-ssl && make -j8 test --without-ssl implies that there will be no inspector but the signal SIGUSR1 is blocked in PlatformInit just the same. But in this case never unblocked which is causing the signal to never be delivered to the handlers in test-signal-handler.js and it loops until it times out. Not sure if this is the best way of fixing this but hopefully more eyes on this will help. PR-URL: nodejs#12266 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 327144f commit 4d6d68c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/node.cc

+4
Original file line numberDiff line numberDiff line change
@@ -4105,10 +4105,12 @@ static void DebugEnd(const FunctionCallbackInfo<Value>& args) {
41054105

41064106
inline void PlatformInit() {
41074107
#ifdef __POSIX__
4108+
#if HAVE_INSPECTOR
41084109
sigset_t sigmask;
41094110
sigemptyset(&sigmask);
41104111
sigaddset(&sigmask, SIGUSR1);
41114112
const int err = pthread_sigmask(SIG_SETMASK, &sigmask, nullptr);
4113+
#endif // HAVE_INSPECTOR
41124114

41134115
// Make sure file descriptors 0-2 are valid before we start logging anything.
41144116
for (int fd = STDIN_FILENO; fd <= STDERR_FILENO; fd += 1) {
@@ -4123,7 +4125,9 @@ inline void PlatformInit() {
41234125
ABORT();
41244126
}
41254127

4128+
#if HAVE_INSPECTOR
41264129
CHECK_EQ(err, 0);
4130+
#endif // HAVE_INSPECTOR
41274131

41284132
#ifndef NODE_SHARED_MODE
41294133
// Restore signal dispositions, the parent process may have changed them.

0 commit comments

Comments
 (0)