Browse Source

child_process: deliver ENOENT on nextTick

After the uv upgrade, uv_spawn will now fail faster for certain
failures like ENOENT. However, our tests and other people may be
depending on that error being passed to the callback instead of a
throw.
v0.11.9-release
Timothy J Fontaine 11 years ago
parent
commit
40d5e9074a
  1. 9
      lib/child_process.js

9
lib/child_process.js

@ -952,7 +952,14 @@ ChildProcess.prototype.spawn = function(options) {
var err = this._handle.spawn(options);
if (err) {
if (!constants)
constants = process.binding('constants');
if (-err == constants.ENOENT) {
process.nextTick(function() {
self._handle.onexit(err);
});
} else if (err) {
// Close all opened fds on error
stdio.forEach(function(stdio) {
if (stdio.type === 'pipe') {

Loading…
Cancel
Save