mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 17:31:11 +02:00
sectionsd: be more tolerant about adjtime() failure
Signed-off-by: Jacek Jendrzej <crashdvb@googlemail.com>
Origin commit data
------------------
Branch: ni/coolstream
Commit: 789d25eab0
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2013-03-05 (Tue, 05 Mar 2013)
------------------
This commit was generated by Migit
This commit is contained in:
committed by
Jacek Jendrzej
parent
1173ab8f1d
commit
13bcfdbe14
@@ -1343,11 +1343,13 @@ void CTimeThread::setSystemTime(time_t tim)
|
||||
tv.tv_sec = timediff / 1000000LL;
|
||||
tv.tv_usec = timediff % 1000000LL;
|
||||
if (adjtime(&tv, &oldd))
|
||||
perror("adjtime");
|
||||
xprintf("difference is < 120s, using adjtime(%d, %d). oldd(%d, %d)\n",
|
||||
(int)tv.tv_sec, (int)tv.tv_usec, (int)oldd.tv_sec, (int)oldd.tv_usec);
|
||||
timediff = 0;
|
||||
return;
|
||||
xprintf("adjtime(%d, %d) failed: %m\n", (int)tv.tv_sec, (int)tv.tv_usec);
|
||||
else {
|
||||
xprintf("difference is < 120s, using adjtime(%d, %d). oldd(%d, %d)\n",
|
||||
(int)tv.tv_sec, (int)tv.tv_usec, (int)oldd.tv_sec, (int)oldd.tv_usec);
|
||||
timediff = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
tv.tv_sec = tim;
|
||||
|
Reference in New Issue
Block a user