mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 09:21:09 +02:00
Fix merge conflict in src/eitd/sectionsd.cpp
Origin commit data
------------------
Branch: ni/coolstream
Commit: 75498935ae
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2016-01-15 (Fri, 15 Jan 2016)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -1380,7 +1380,7 @@ void CTimeThread::waitForTimeset(void)
|
|||||||
time_mutex.unlock();
|
time_mutex.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTimeThread::setSystemTime(time_t tim)
|
bool CTimeThread::setSystemTime(time_t tim, bool force)
|
||||||
{
|
{
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
struct tm t;
|
struct tm t;
|
||||||
@@ -1388,6 +1388,7 @@ void CTimeThread::setSystemTime(time_t tim)
|
|||||||
gettimeofday(&tv, NULL);
|
gettimeofday(&tv, NULL);
|
||||||
timediff = int64_t(tim * 1000000 - (tv.tv_usec + tv.tv_sec * 1000000));
|
timediff = int64_t(tim * 1000000 - (tv.tv_usec + tv.tv_sec * 1000000));
|
||||||
localtime_r(&tv.tv_sec, &t);
|
localtime_r(&tv.tv_sec, &t);
|
||||||
|
int absdiff = abs(tim - tv.tv_sec);
|
||||||
|
|
||||||
xprintf("%s: timediff %" PRId64 ", current: %02d.%02d.%04d %02d:%02d:%02d, dvb: %s",
|
xprintf("%s: timediff %" PRId64 ", current: %02d.%02d.%04d %02d:%02d:%02d, dvb: %s",
|
||||||
name.c_str(), timediff,
|
name.c_str(), timediff,
|
||||||
@@ -1399,9 +1400,9 @@ void CTimeThread::setSystemTime(time_t tim)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (timediff == 0) /* very unlikely... :-) */
|
if (absdiff < 1) /* do not bother for differences less than one second */
|
||||||
return;
|
return true;
|
||||||
if (timeset && abs(tim - tv.tv_sec) < 120) { /* abs() is int */
|
if (absdiff < 120) {
|
||||||
struct timeval oldd;
|
struct timeval oldd;
|
||||||
tv.tv_sec = time_t(timediff / 1000000LL);
|
tv.tv_sec = time_t(timediff / 1000000LL);
|
||||||
tv.tv_usec = suseconds_t(timediff % 1000000LL);
|
tv.tv_usec = suseconds_t(timediff % 1000000LL);
|
||||||
@@ -1411,14 +1412,21 @@ void CTimeThread::setSystemTime(time_t tim)
|
|||||||
xprintf("difference is < 120s, using adjtime(%d, %d). oldd(%d, %d)\n",
|
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);
|
(int)tv.tv_sec, (int)tv.tv_usec, (int)oldd.tv_sec, (int)oldd.tv_usec);
|
||||||
timediff = 0;
|
timediff = 0;
|
||||||
return;
|
return true;
|
||||||
}
|
}
|
||||||
|
} else if (timeset && ! force) {
|
||||||
|
xprintf("difference is > 120s, try again and set 'force=true'\n");
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
/* still fall through if adjtime() failed */
|
||||||
|
|
||||||
tv.tv_sec = tim;
|
tv.tv_sec = tim;
|
||||||
tv.tv_usec = 0;
|
tv.tv_usec = 0;
|
||||||
if (settimeofday(&tv, NULL) < 0)
|
if (settimeofday(&tv, NULL) == 0)
|
||||||
perror("[sectionsd] settimeofday");
|
return true;
|
||||||
|
|
||||||
|
perror("[sectionsd] settimeofday");
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTimeThread::addFilters()
|
void CTimeThread::addFilters()
|
||||||
|
Reference in New Issue
Block a user