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:
Tor Arne Vestbø
2016-07-05 17:40:53 +02:00
parent f76ab76c4a
commit 852c9832a0
2 changed files with 5 additions and 2 deletions

View File

@@ -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;
}