From bd2fc3e436e189cfc1e0f8f2892e0daa09090300 Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Mon, 8 Jan 2018 09:11:33 +0000 Subject: [PATCH] Correctly handle start timeout of 0 (i.e. no timeout). --- src/service.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/service.cc b/src/service.cc index ce2ec5d..bed9f2e 100644 --- a/src/service.cc +++ b/src/service.cc @@ -902,8 +902,14 @@ bool base_process_service::bring_up() noexcept eventLoop.get_time(restart_interval_time, clock_type::MONOTONIC); restart_interval_count = 0; if (start_ps_process(exec_arg_parts, onstart_flags.starts_on_console)) { - restart_timer.arm_timer_rel(eventLoop, start_timeout); - stop_timer_armed = true; + if (start_timeout != time_val(0,0)) { + restart_timer.arm_timer_rel(eventLoop, start_timeout); + stop_timer_armed = true; + } + else if (stop_timer_armed) { + restart_timer.stop_timer(eventLoop); + stop_timer_armed = false; + } return true; } return false; -- 2.25.1