From f2acb732bcba3504d316a7ef715ea9b19d326552 Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Mon, 26 Jun 2017 10:15:25 +0100 Subject: [PATCH] process service: more fixes to child watch reservation. --- src/service.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 -- 2.25.1