summaryrefslogtreecommitdiff
path: root/eit.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2001-10-19 13:22:24 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2001-10-19 13:22:24 +0200
commit6de7f7e8b2233189115fca4dec705e946359516f (patch)
tree6707bba23513cee66c5bd4a6a73ab7fb8fdfe017 /eit.c
parent6c41138bdd546c1e833b5172901a98da38f1a849 (diff)
downloadvdr-6de7f7e8b2233189115fca4dec705e946359516f.tar.gz
vdr-6de7f7e8b2233189115fca4dec705e946359516f.tar.bz2
Fixed timers starting and ending at unexpected times
Diffstat (limited to 'eit.c')
-rw-r--r--eit.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/eit.c b/eit.c
index f57145b8..71ab54c3 100644
--- a/eit.c
+++ b/eit.c
@@ -16,7 +16,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
- * $Id: eit.c 1.27 2001/10/07 14:35:25 kls Exp $
+ * $Id: eit.c 1.28 2001/10/19 13:13:25 kls Exp $
***************************************************************************/
#include "eit.h"
@@ -126,7 +126,8 @@ bool cMJD::SetSystemTime()
struct tm *ptm;
time_t loctim;
- ptm = localtime(&mjdtime);
+ struct tm tm_r;
+ ptm = localtime_r(&mjdtime, &tm_r);
loctim = time(NULL);
if (abs(mjdtime - loctim) > 2)
@@ -240,7 +241,8 @@ const char * cEventInfo::GetDate() const
{
static char szDate[25];
- strftime(szDate, sizeof(szDate), "%d.%m.%Y", localtime(&tTime));
+ struct tm tm_r;
+ strftime(szDate, sizeof(szDate), "%d.%m.%Y", localtime_r(&tTime, &tm_r));
return szDate;
}
@@ -249,7 +251,8 @@ const char * cEventInfo::GetTimeString() const
{
static char szTime[25];
- strftime(szTime, sizeof(szTime), "%R", localtime(&tTime));
+ struct tm tm_r;
+ strftime(szTime, sizeof(szTime), "%R", localtime_r(&tTime, &tm_r));
return szTime;
}
@@ -259,7 +262,8 @@ const char * cEventInfo::GetEndTimeString() const
static char szEndTime[25];
time_t tEndTime = tTime + lDuration;
- strftime(szEndTime, sizeof(szEndTime), "%R", localtime(&tEndTime));
+ struct tm tm_r;
+ strftime(szEndTime, sizeof(szEndTime), "%R", localtime_r(&tEndTime, &tm_r));
return szEndTime;
}
@@ -467,7 +471,8 @@ void cEventInfo::FixEpgBugs(void)
// correctly on the ASTRA satellite system.
if (uServiceID == 898 // Pro-7
|| uServiceID == 899) { // Kabel 1
- tm *t = localtime(&tTime);
+ struct tm tm_r;
+ tm *t = localtime_r(&tTime, &tm_r);
if (t->tm_hour * 3600 + t->tm_min * 60 + t->tm_sec <= 6 * 3600)
tTime += 24 * 3600;
}
@@ -886,7 +891,8 @@ void cSIProcessor::Action()
if (masterSIProcessor)
{
time_t now = time(NULL);
- struct tm *ptm = localtime(&now);
+ struct tm tm_r;
+ struct tm *ptm = localtime_r(&now, &tm_r);
if (now - lastCleanup > 3600 && ptm->tm_hour == 5)
{
LOCK_THREAD;