Skip to content

Commit

Permalink
process: create stdin with manualStart: true
Browse files Browse the repository at this point in the history
Otherwise Node.js will try to read data from the handle.
This causes issues when Node.js is already reading from the
same handle, but a different associated stream
(e.g. a possible IPC channel).

PR-URL: #19377
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
addaleax committed May 14, 2018
1 parent f2ad1d5 commit c8fe8e8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/internal/process/stdio.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,15 @@ function setupStdio() {
stdin = new net.Socket({
handle: process.channel,
readable: true,
writable: false
writable: false,
manualStart: true
});
} else {
stdin = new net.Socket({
fd: fd,
readable: true,
writable: false
writable: false,
manualStart: true
});
}
// Make sure the stdin can't be `.end()`-ed
Expand Down

0 comments on commit c8fe8e8

Please sign in to comment.