lib: child_process spawn handle ENOENT correctly
authorAlexis Campailla <alexis@janeasystems.com>
Wed, 4 Dec 2013 19:04:47 +0000 (11:04 -0800)
committerTimothy J Fontaine <tjfontaine@gmail.com>
Thu, 5 Dec 2013 19:59:22 +0000 (11:59 -0800)
child_process spawn wasn't handlig ENOENT correctly on Windows.
This is half a fix for test-child-process-cwd.js.
The other half is going into libuv.

lib/child_process.js

index 96193a8..75a637e 100644 (file)
@@ -952,10 +952,7 @@ ChildProcess.prototype.spawn = function(options) {
 
   var err = this._handle.spawn(options);
 
-  if (!constants)
-    constants = process.binding('constants');
-
-  if (-err == constants.ENOENT) {
+  if (err == uv.UV_ENOENT) {
     process.nextTick(function() {
       self._handle.onexit(err);
     });