From 65a6e05da5ffa7559c11b5045880cdc81be7854f Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Fri, 7 Apr 2017 08:48:32 +0200 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/12266 Reviewed-By: Ben Noordhuis Reviewed-By: Anna Henningsen --- src/node.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/node.cc b/src/node.cc index 619939d74dcf09..73a5a870565d8b 100644 --- a/src/node.cc +++ b/src/node.cc @@ -4074,10 +4074,12 @@ static void DebugEnd(const FunctionCallbackInfo& args) { inline void PlatformInit() { #ifdef __POSIX__ +#if HAVE_INSPECTOR sigset_t sigmask; sigemptyset(&sigmask); sigaddset(&sigmask, SIGUSR1); const int err = pthread_sigmask(SIG_SETMASK, &sigmask, nullptr); +#endif // HAVE_INSPECTOR // Make sure file descriptors 0-2 are valid before we start logging anything. for (int fd = STDIN_FILENO; fd <= STDERR_FILENO; fd += 1) { @@ -4092,7 +4094,9 @@ inline void PlatformInit() { ABORT(); } +#if HAVE_INSPECTOR CHECK_EQ(err, 0); +#endif // HAVE_INSPECTOR #ifndef NODE_SHARED_MODE // Restore signal dispositions, the parent process may have changed them.