// Emits a JobExit event if both rstreams are closed static void exit_cb(uv_process_t *proc, int64_t status, int term_signal) { Job *job = handle_get_job((uv_handle_t *)proc); if (--job->pending_refs == 0) { emit_exit_event(job); } }
// Emits a JobExit event if both rstreams are closed static void exit_cb(uv_process_t *proc, int64_t status, int term_signal) { Job *job = proc->data; if (--job->pending_refs == 0) { emit_exit_event(job); } }
// Wraps the call to std{out,err}_cb and emits a JobExit event if necessary. static void read_cb(RStream *rstream, void *data, bool eof) { Job *job = data; if (rstream == job->out) { job->stdout_cb(rstream, data, eof); } else { job->stderr_cb(rstream, data, eof); } if (eof && --job->pending_refs == 0) { emit_exit_event(job); } }