From: Michael Friedrich Date: Thu, 24 Jan 2019 09:58:43 +0000 (+0100) Subject: Merge pull request #6899 from Icinga/bugfix/localtime-zero-windows X-Git-Tag: v2.11.0-rc1~255 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6b7f6514783bfc0b020ee8a2c4b81e64d2de642f;p=icinga2 Merge pull request #6899 from Icinga/bugfix/localtime-zero-windows Log: Ensure not to pass negative values to localtime() --- 6b7f6514783bfc0b020ee8a2c4b81e64d2de642f diff --cc lib/icinga/checkable-check.cpp index b159247a9,f8b1d1ff7..0b8917b77 --- a/lib/icinga/checkable-check.cpp +++ b/lib/icinga/checkable-check.cpp @@@ -79,10 -79,10 +79,11 @@@ void Checkable::UpdateNextCheck(const M if (interval > 1) adj = fmod(now * 100 + GetSchedulingOffset(), interval * 100) / 100.0; - adj = std::min(0.5 + fmod(GetSchedulingOffset(), interval * 5) / 100.0, adj); + if (adj != 0.0) + adj = std::min(0.5 + fmod(GetSchedulingOffset(), interval * 5) / 100.0, adj); double nextCheck = now - adj + interval; + double lastCheck = GetLastCheck(); Log(LogDebug, "Checkable") << "Update checkable '" << GetName() << "' with check interval '" << GetCheckInterval()