From: Davin McCall Date: Mon, 26 Jun 2017 09:15:25 +0000 (+0100) Subject: process service: more fixes to child watch reservation. X-Git-Tag: v0.06~41 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f2acb732bcba3504d316a7ef715ea9b19d326552;p=oweals%2Fdinit.git process service: more fixes to child watch reservation. --- diff --git a/src/service.cc b/src/service.cc index 54fe73d..b6d726a 100644 --- a/src/service.cc +++ b/src/service.cc @@ -125,14 +125,15 @@ dasynq::rearm service_child_watcher::status_change(eventloop_t &loop, pid_t chil if (sr->waiting_for_execstat) { // We still don't have an exec() status from the forked child, wait for that // before doing any further processing. - return rearm::REMOVE; + return rearm::NOOP; // hold watch reservation } - // Must deregister now since handle_exit_status might result in re-launch: - deregister(loop, child); + // Must stop watch now since handle_exit_status might result in re-launch: + // (stop_watch instead of deregister, so that we hold watch reservation). + stop_watch(loop); sr->handle_exit_status(status); - return rearm::REMOVED; + return rearm::NOOP; } bool service_record::do_auto_restart() noexcept