Merge pull request #9716 from LunaMoo/TimeStuff

Init rtcBaseTime.tv_usec to 0 to return matching time in some syscalls
This commit is contained in:
Unknown W. Brackets 2017-05-23 22:47:41 -04:00 committed by GitHub
commit 1bf3885048

View file

@ -129,7 +129,7 @@ void __RtcInit()
timeval tv;
gettimeofday(&tv, NULL);
rtcBaseTime.tv_sec = tv.tv_sec;
rtcBaseTime.tv_usec = tv.tv_usec;
rtcBaseTime.tv_usec = 0;
// Precalculate the current time in microseconds (rtcMagicOffset is offset to 1970.)
rtcBaseTicks = 1000000ULL * rtcBaseTime.tv_sec + rtcBaseTime.tv_usec + rtcMagicOffset;
}