Forward customFds to ChildProcess.spawn
authorRyan Dahl <ry@tinyclouds.org>
Wed, 14 Sep 2011 19:33:38 +0000 (12:33 -0700)
committerRyan Dahl <ry@tinyclouds.org>
Wed, 14 Sep 2011 19:33:42 +0000 (12:33 -0700)
Fixes #1695

lib/child_process_uv.js

index 8a9216c..75383c8 100644 (file)
@@ -195,8 +195,6 @@ exports.execFile = function(file /* args, options, callback */) {
 
 
 var spawn = exports.spawn = function(file, args, options) {
-  var child = new ChildProcess();
-
   var args = args ? args.slice(0) : [];
   args.unshift(file);
 
@@ -207,12 +205,15 @@ var spawn = exports.spawn = function(file, args, options) {
     envPairs.push(key + '=' + env[key]);
   }
 
+  var child = new ChildProcess();
+
   child.spawn({
     file: file,
     args: args,
     cwd: options ? options.cwd : null,
     windowsVerbatimArguments: !!(options && options.windowsVerbatimArguments),
-    envPairs: envPairs
+    envPairs: envPairs,
+    customFds: options ? options.customFds : null
   });
 
   return child;