Browse Source

debugger: exit and kill child on SIGTERM or SIGHUP

v0.9.4-release
Fedor Indutny 12 years ago
committed by Ben Noordhuis
parent
commit
05882668f9
  1. 7
      lib/_debugger.js
  2. 3
      test/simple/test-debugger-repl-utf8.js
  3. 3
      test/simple/test-debugger-repl.js

7
lib/_debugger.js

@ -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',

3
test/simple/test-debugger-repl-utf8.js

@ -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() {

3
test/simple/test-debugger-repl.js

@ -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() {

Loading…
Cancel
Save