mirror of
https://github.com/nodejs/node-v0.x-archive.git
synced 2026-04-28 03:01:10 -04:00
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)
11 lines
310 B
JavaScript
11 lines
310 B
JavaScript
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);
|
|
}); |