Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

addon: fix snapshot truncation, ignore SIGINT

Ignore SIGINT signals so that a C-c to the parent process doesn't kill the
child process that's busy writing out the heap snapshot.
  • Loading branch information...
commit 1d49679918aeedc918c06ffeff72651b1630af52 1 parent 4b8cad5
Ben Noordhuis authored November 21, 2012

Showing 1 changed file with 6 additions and 0 deletions. Show diff stats Hide diff stats

  1. 6  src/heapdump.cc
6  src/heapdump.cc
@@ -77,6 +77,12 @@ void AsyncEvent(uv_async_t* handle, int status)
77 77
   assert(handle == &async_handle);
78 78
   if (fork() != 0) return;
79 79
 
  80
+  // Stop C-c to main process from killing us.
  81
+  struct sigaction sa;
  82
+  memset(&sa, 0, sizeof(sa));
  83
+  sa.sa_handler = SIG_IGN;
  84
+  if (sigaction(SIGINT, &sa, NULL)) abort();
  85
+
80 86
   timeval tv;
81 87
   if (gettimeofday(&tv, NULL)) abort();
82 88
 

0 notes on commit 1d49679

Please sign in to comment.
Something went wrong with that request. Please try again.