sectionsd: don't truncate 64bit value before comparing

This commit is contained in:
Stefan Seyfried
2013-03-05 19:43:09 +01:00
parent 478d59dd2f
commit d558218115

View File

@@ -1337,7 +1337,7 @@ void CTimeThread::setSystemTime(time_t tim)
#endif #endif
if (timediff == 0) /* very unlikely... :-) */ if (timediff == 0) /* very unlikely... :-) */
return; return;
if (abs(timediff) < 120000000LL) { if (abs(tim - tv.tv_sec) < 120) { /* abs() is int */
struct timeval oldd; struct timeval oldd;
tv.tv_sec = timediff / 1000000LL; tv.tv_sec = timediff / 1000000LL;
tv.tv_usec = timediff % 1000000LL; tv.tv_usec = timediff % 1000000LL;