Skip to content

Instantly share code, notes, and snippets.

@bnoordhuis
Created February 26, 2013 02:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bnoordhuis/8ad33765b178502598ad to your computer and use it in GitHub Desktop.
Save bnoordhuis/8ad33765b178502598ad to your computer and use it in GitHub Desktop.
diff --git a/src/node.cc b/src/node.cc
index 63fb2f4..923837c 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -2715,7 +2715,7 @@ static void EnableDebug(bool wait_connect) {
#ifdef __POSIX__
-static void EnableDebugSignalHandler(int signal) {
+static void EnableDebugSignalHandler(uv_signal_t* handle, int) {
// Break once process will return execution to v8
v8::Debug::DebugBreak(node_isolate);
@@ -2997,7 +2997,9 @@ char** Init(int argc, char *argv[]) {
#ifdef _WIN32
RegisterDebugSignalHandler();
#else // Posix
- RegisterSignalHandler(SIGUSR1, EnableDebugSignalHandler);
+ static uv_signal_t signal_watcher;
+ uv_signal_init(uv_default_loop(), &signal_watcher);
+ uv_signal_start(&signal_watcher, EnableDebugSignalHandler, SIGUSR1);
#endif // __POSIX__
}
@isaacs
Copy link

isaacs commented Feb 26, 2013

For some reason, with this patch, it doesn't exit the test. It looks like there's still a child proc and the debugger client both tracked as active handles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment