summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2001-09-23 10:04:26 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2001-09-23 10:04:26 +0200
commit53364f924838febe854b8341c507c0ad69a628a9 (patch)
treee385175e699d67ef8c69c210d77b956f46cdb68c
parent9f1046221d2fd6f8b4b2713174eccb7fe535e6d3 (diff)
downloadvdr-53364f924838febe854b8341c507c0ad69a628a9.tar.gz
vdr-53364f924838febe854b8341c507c0ad69a628a9.tar.bz2
Implemented a check to see whether the system time is running linearly
-rw-r--r--HISTORY1
-rw-r--r--vdr.c11
2 files changed, 11 insertions, 1 deletions
diff --git a/HISTORY b/HISTORY
index 66cac63e..4f0381aa 100644
--- a/HISTORY
+++ b/HISTORY
@@ -780,3 +780,4 @@ Video Disk Recorder Revision History
next program start.
- New command line option '-r' to define a command that gets called before and
after each recording (see INSTALL for details).
+- Implemented a check to see whether the system time is running linearly.
diff --git a/vdr.c b/vdr.c
index 6effc0ff..e92dc426 100644
--- a/vdr.c
+++ b/vdr.c
@@ -22,7 +22,7 @@
*
* The project's page is at http://www.cadsoft.de/people/kls/vdr
*
- * $Id: vdr.c 1.75 2001/09/22 14:05:40 kls Exp $
+ * $Id: vdr.c 1.76 2001/09/23 09:58:36 kls Exp $
*/
#define _GNU_SOURCE
@@ -310,6 +310,7 @@ int main(int argc, char *argv[])
int LastChannel = -1;
int PreviousChannel = cDvbApi::CurrentChannel();
time_t LastActivity = 0;
+ time_t LinearTime = time(NULL);
int MaxLatencyTime = 0;
bool ForceShutdown = false;
@@ -319,6 +320,14 @@ int main(int argc, char *argv[])
}
while (!Interrupted) {
+ // Test if we are running in the Einstein continuum:
+ time_t Now = time(NULL);
+ time_t LinearDelta = Now - LinearTime;
+ if (LinearDelta) {
+ if (LinearDelta < 0 || LinearDelta > 300) // assuming nothing will block for more than 5 minutes
+ esyslog(LOG_ERR, "ERROR: time warp detected (%d seconds)", LinearDelta);
+ LinearTime = Now;
+ }
// Handle emergency exits:
if (cThread::EmergencyExit()) {
esyslog(LOG_ERR, "emergency exit requested - shutting down");