From 323120b5c943c0ec04c482c4414c23c01a27f4fc Mon Sep 17 00:00:00 2001 From: Scott Blomquist Date: Fri, 15 Feb 2013 17:25:57 -0800 Subject: [PATCH] child_process: handle ENOENT correctly on Windows --- lib/child_process.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/child_process.js b/lib/child_process.js index 4a9922e..a4a5d2b 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -884,9 +884,9 @@ ChildProcess.prototype.spawn = function(options) { if (stdio.handle) { // when i === 0 - we're dealing with stdin // (which is the only one writable pipe) - stdio.socket = createSocket(stdio.handle, i > 0); + stdio.socket = createSocket(self.pid !== 0 ? stdio.handle : null, i > 0); - if (i > 0) { + if (i > 0 && self.pid !== 0) { self._closesNeeded++; stdio.socket.on('close', function() { maybeClose(self); -- 2.7.4