Skip to content

Commit

Permalink
close the channel to the parent if process has been forked to avoid f…
Browse files Browse the repository at this point in the history
…ailed assertion
  • Loading branch information
tomyan committed Oct 18, 2011
1 parent 7febecf commit 5635d4a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ Object.keys(binding).forEach(function (k) { daemon[k] = binding[k] });
//
daemon.start = function (fd) {
var pid;
process.stdout.write('');
process.stderr.write('');
if (process._channel) {
// stops failed assertion when used in forked process
process._channel.close();
}
if (typeof(fd) === 'object') {
process.stdout.write('');
process.stderr.write('');
pid = binding.start(fd.stdout, fd.stderr);
}
else {
Expand Down

0 comments on commit 5635d4a

Please sign in to comment.