Permalink
Browse files

debugger: exit and kill child on SIGTERM or SIGHUP

  • Loading branch information...
1 parent 83e5e20 commit 05882668f97c2533a5de757637033d36bcf93fac @indutny indutny committed with bnoordhuis Oct 17, 2012
Showing with 8 additions and 5 deletions.
  1. +4 −3 lib/_debugger.js
  2. +2 −1 test/simple/test-debugger-repl-utf8.js
  3. +2 −1 test/simple/test-debugger-repl.js
View
@@ -782,9 +782,10 @@ function Interface(stdin, stdout, args) {
process.exit(0);
});
- process.on('exit', function() {
- self.killChild();
- });
+ // Handle all possible exits
+ process.on('exit', this.killChild.bind(this));
+ process.once('SIGTERM', process.exit.bind(process, 0));
+ process.once('SIGHUP', process.exit.bind(process, 0));
var proto = Interface.prototype,
ignored = ['pause', 'resume', 'exitRepl', 'handleBreak',
@@ -155,7 +155,8 @@ setTimeout(function() {
err = err + '. Expected: ' + expected[0].lines.shift();
}
quit();
- child.kill('SIGKILL');
+ child.kill('SIGINT');
+ child.kill('SIGTERM');
// give the sigkill time to work.
setTimeout(function() {
@@ -192,7 +192,8 @@ setTimeout(function() {
err = err + '. Expected: ' + expected[0].lines.shift();
}
quit();
- child.kill('SIGKILL');
+ child.kill('SIGINT');
+ child.kill('SIGTERM');
// give the sigkill time to work.
setTimeout(function() {

0 comments on commit 0588266

Please sign in to comment.