summaryrefslogtreecommitdiff
path: root/src/process_wrap.cc
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2012-08-21 13:29:53 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2012-08-21 14:29:20 +0200
commit63d13e86a58b2885c388f57a53227c2a23c83b49 (patch)
tree391836f3faa54c5e1905deede6e65261f5168e25 /src/process_wrap.cc
parent2cdf427dce90d258d162eb308a0685e94ea78a73 (diff)
downloadnode-63d13e86a58b2885c388f57a53227c2a23c83b49.tar.gz
child_process: emit error on exec failure
libuv calls the exit cb with exit code == -1 when it fails to spawn the new process. Anticipate that and emit the error on the ChildProcess object.
Diffstat (limited to 'src/process_wrap.cc')
-rw-r--r--src/process_wrap.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/process_wrap.cc b/src/process_wrap.cc
index b156692ac..60f422d35 100644
--- a/src/process_wrap.cc
+++ b/src/process_wrap.cc
@@ -294,9 +294,14 @@ class ProcessWrap : public HandleWrap {
String::New(signo_string(term_signal))
};
+ if (exit_status == -1) {
+ SetErrno(uv_last_error(uv_default_loop()));
+ }
+
if (onexit_sym.IsEmpty()) {
onexit_sym = NODE_PSYMBOL("onexit");
}
+
MakeCallback(wrap->object_, onexit_sym, ARRAY_SIZE(argv), argv);
}