Permalink
Browse files

Merge pull request #47 from bigeasy/child-close

Wait on `close` instead of `exit`.
  • Loading branch information...
2 parents 158a638 + d356d0b commit 4e68d0e7eb2518ddefb9393b8cbd3a4d1321d947 @rsms committed Sep 22, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 imagemagick.js
View
@@ -79,7 +79,8 @@ function exec2(file, args /*, options, callback */) {
child.stdout.addListener("data", function (chunk) { std.out(chunk, options.encoding); });
child.stderr.addListener("data", function (chunk) { std.err(chunk, options.encoding); });
- child.addListener("exit", function (code, signal) {
+ var version = process.versions.node.split('.');
+ child.addListener(version[0] == 0 && version[1] < 7 ? "exit" : "close", function (code, signal) {
if (timeoutId) clearTimeout(timeoutId);
if (code === 0 && signal === null) {
std.finish(null);

0 comments on commit 4e68d0e

Please sign in to comment.