Skip to content

Commit

Permalink
Let the child process connect to stdout and stderr directly.
Browse files Browse the repository at this point in the history
There is no need to proxy it.  
(Thanks pgriess)
  • Loading branch information
creationix committed Jul 20, 2010
1 parent 68ef96a commit 9d84e5a
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions bin/spark
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ function start() {
process.argv[0],
[__filename, '--child'],
undefined,
[fds[1], -1, -1]
[fds[1], 1, 2]
);
log('child spawned [bold]{' + child.pid + '}');

Expand All @@ -353,15 +353,6 @@ function start() {

child.stdin.write(JSON.stringify(env), 'ascii', fd);

// Log stdout / stderr
child.stdout.addListener('data', function(data){
process.stdout.write(data);
});
child.stderr.addListener('data', function(data){
// TODO: add a public API version of this.
// I'm not sure node has one yet.
process.binding('stdio').writeError(data);
});
}

changeUser();
Expand Down

0 comments on commit 9d84e5a

Please sign in to comment.