mirror of https://github.com/lukechilds/node.git
Browse Source
The child process 'exit' was returning the status of the process, rather than the exit code. This patch properly deconstructs the status into the exit code and the term signal a process may have received. See: http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#Watcher_Specific_Functions_and_Data_-5 and waitpid(2)v0.7.4-release
Felix Geisendörfer
15 years ago
committed by
Ryan Dahl
9 changed files with 205 additions and 20 deletions
@ -0,0 +1 @@ |
|||||
|
process.exit(process.argv[2] || 1); |
@ -0,0 +1,11 @@ |
|||||
|
require("../common"); |
||||
|
var spawn = require('child_process').spawn |
||||
|
, path = require('path') |
||||
|
, sub = path.join(fixturesDir, 'exit.js') |
||||
|
, child = spawn(process.argv[0], [sub, 23]) |
||||
|
; |
||||
|
|
||||
|
child.addListener('exit', function(code, signal) { |
||||
|
assert.strictEqual(code, 23); |
||||
|
assert.strictEqual(signal, null); |
||||
|
}); |
Loading…
Reference in new issue