From: Davin McCall Date: Fri, 2 Jun 2017 17:49:13 +0000 (+0100) Subject: Correct calculation of restart timeout, and up timeout to 200ms. X-Git-Tag: v0.06~107 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e327633a36cd60007ed504530a26baeea17ae9d0;p=oweals%2Fdinit.git Correct calculation of restart timeout, and up timeout to 200ms. --- diff --git a/src/service.cc b/src/service.cc index 08145e2..69e8cbc 100644 --- a/src/service.cc +++ b/src/service.cc @@ -1191,14 +1191,14 @@ void base_process_service::restart_ps_process() noexcept tdiff_ns = 1000000000 - (last_start_time.tv_nsec - current_time.tv_nsec); } - if (tdiff_s > 0 || tdiff_ns > 100000000) { - // > 100ms + if (tdiff_s > 0 || tdiff_ns > 200000000) { + // > 200ms start_ps_process(); } else { timespec timeout; - timeout.tv_sec = tdiff_s; - timeout.tv_nsec = tdiff_ns; + timeout.tv_sec = 0; + timeout.tv_nsec = 200000000 - tdiff_ns; restart_timer.arm_timer_rel(eventLoop, timeout); } }