mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Fix inverted gettimeofday() return value handling
The gettimeofday function returns 0 for success, not for failure. As a result of the inverted logic we were losing millisecond precision when parsing incoming messages on non-HAVE_CLOCK_GETTIME systems (macOS).
This commit is contained in:
@@ -225,7 +225,7 @@ void CMessage::InitTime() {
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!gettimeofday(&m_time, nullptr)) {
|
||||
if (gettimeofday(&m_time, nullptr)) {
|
||||
m_time.tv_sec = time(nullptr);
|
||||
m_time.tv_usec = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user