From 5635d4a5bb2b59a4e57fdaad40b3ea50b2ec4d5e Mon Sep 17 00:00:00 2001 From: Tom Yandell Date: Tue, 18 Oct 2011 08:39:58 +0100 Subject: [PATCH] close the channel to the parent if process has been forked to avoid failed assertion --- lib/daemon.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/daemon.js b/lib/daemon.js index 983984e..c8c927d 100644 --- a/lib/daemon.js +++ b/lib/daemon.js @@ -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 {