mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
sectionsd: be more tolerant about adjtime() failure
This commit is contained in:
@@ -1342,11 +1342,13 @@ void CTimeThread::setSystemTime(time_t tim)
|
|||||||
tv.tv_sec = timediff / 1000000LL;
|
tv.tv_sec = timediff / 1000000LL;
|
||||||
tv.tv_usec = timediff % 1000000LL;
|
tv.tv_usec = timediff % 1000000LL;
|
||||||
if (adjtime(&tv, &oldd))
|
if (adjtime(&tv, &oldd))
|
||||||
perror("adjtime");
|
xprintf("adjtime(%d, %d) failed: %m\n", (int)tv.tv_sec, (int)tv.tv_usec);
|
||||||
xprintf("difference is < 120s, using adjtime(%d, %d). oldd(%d, %d)\n",
|
else {
|
||||||
(int)tv.tv_sec, (int)tv.tv_usec, (int)oldd.tv_sec, (int)oldd.tv_usec);
|
xprintf("difference is < 120s, using adjtime(%d, %d). oldd(%d, %d)\n",
|
||||||
timediff = 0;
|
(int)tv.tv_sec, (int)tv.tv_usec, (int)oldd.tv_sec, (int)oldd.tv_usec);
|
||||||
return;
|
timediff = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tv.tv_sec = tim;
|
tv.tv_sec = tim;
|
||||||
|
Reference in New Issue
Block a user