summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhorchi <vdr@jwendel.de>2017-12-21 17:58:26 +0100
committerhorchi <vdr@jwendel.de>2017-12-21 17:58:26 +0100
commitec257583c911ab914b67ccac45e935ecca65b9cd (patch)
tree02593e8a7e253adb3fd1057c4b51c650fb4240a7
parente2a6da5cbdb935283f95a89d562fe870dad23666 (diff)
downloadvdr-epg-daemon-ec257583c911ab914b67ccac45e935ecca65b9cd.tar.gz
vdr-epg-daemon-ec257583c911ab914b67ccac45e935ecca65b9cd.tar.bz2
2017-12-21: version 1.1.124 (horchi)\n - change: gcc 7 porting\n\n1.1.124
-rw-r--r--HISTORY.h7
-rw-r--r--configs/epg.dat1
-rw-r--r--httpd.c5
-rw-r--r--lib/thread.c72
-rw-r--r--main.c11
5 files changed, 51 insertions, 45 deletions
diff --git a/HISTORY.h b/HISTORY.h
index 1f554d6..00fc31e 100644
--- a/HISTORY.h
+++ b/HISTORY.h
@@ -4,8 +4,8 @@
* -----------------------------------
*/
-#define _VERSION "1.1.123"
-#define VERSION_DATE "02.12.2017"
+#define _VERSION "1.1.124"
+#define VERSION_DATE "21.12.2017"
#define DB_API 4
#ifdef GIT_REV
@@ -18,6 +18,9 @@
* ------------------------------------
*
+2017-12-21: version 1.1.124 (horchi)
+ - change: gcc 7 porting
+
2017-12-02: version 1.1.123 (horchi)
- added: Trigger osd2web plugins of running VDRs on new recording
diff --git a/configs/epg.dat b/configs/epg.dat
index 0959093..8832bc8 100644
--- a/configs/epg.dat
+++ b/configs/epg.dat
@@ -502,6 +502,7 @@ Table recordinglist
TITLE "" title Ascii 200 Data,
SHORTTEXT "" shorttext Ascii 300 Data,
LONGDESCRIPTION "" longdescription MText 25000 Data,
+ ORGDESCRIPTION "" orgdescription MText 25000 Data,
DURATION "" duration UInt 0 Data,
FSK "" fsk UInt 1 Data,
diff --git a/httpd.c b/httpd.c
index 934d1d0..a4e3295 100644
--- a/httpd.c
+++ b/httpd.c
@@ -2223,9 +2223,10 @@ int main(int argc, char** argv)
case 'n': nofork = yes; break;
case 'l': if (argv[i+1]) loglevel = atoi(argv[++i]); break;
case 'c': if (argv[i+1]) confDir = argv[++i]; break;
- case 'i': if (argv[i+1])
+ case 'i':
{
- cSystemNotification::setPidFile(argv[++i]);
+ if (argv[i+1])
+ cSystemNotification::setPidFile(argv[++i]);
break;
}
diff --git a/lib/thread.c b/lib/thread.c
index 5938d75..4f2cbfe 100644
--- a/lib/thread.c
+++ b/lib/thread.c
@@ -1,5 +1,5 @@
/*
- * thread.c:
+ * thread.c:
*
* See the README file for copyright information and how to reach the author.
*
@@ -17,12 +17,12 @@
// get abs time plus 'millisecondsFromNow'
//***************************************************************************
-static bool absTime(struct timespec* abstime, int millisecondsFromNow)
+static int absTime(struct timespec* abstime, int millisecondsFromNow)
{
struct timeval now;
- if (gettimeofday(&now, 0) == 0)
- {
+ if (gettimeofday(&now, 0) == 0)
+ {
// get current time
now.tv_sec += millisecondsFromNow / 1000; // add full seconds
@@ -30,8 +30,8 @@ static bool absTime(struct timespec* abstime, int millisecondsFromNow)
// take care of an overflow
- if (now.tv_usec >= 1000000)
- {
+ if (now.tv_usec >= 1000000)
+ {
now.tv_sec++;
now.tv_usec -= 1000000;
}
@@ -56,7 +56,7 @@ cThread::cThread(const char* Description, bool LowPriority)
childThreadId = 0;
description = 0;
silent = no;
-
+
if (Description)
SetDescription("%s", Description);
@@ -74,7 +74,7 @@ void cThread::SetDescription(const char *Description, ...)
free(description);
description = NULL;
- if (Description)
+ if (Description)
{
va_list ap;
va_start(ap, Description);
@@ -86,7 +86,7 @@ void cThread::SetDescription(const char *Description, ...)
void *cThread::StartThread(cThread *Thread)
{
Thread->childThreadId = ThreadId();
- if (Thread->description)
+ if (Thread->description)
{
tell(Thread->silent ? 2 : 0, "'%s' thread started (pid=%d, tid=%d, prio=%s)", Thread->description, getpid(), Thread->childThreadId, Thread->lowPriority ? "low" : "high");
#ifdef PR_SET_NAME
@@ -95,7 +95,7 @@ void *cThread::StartThread(cThread *Thread)
#endif
}
- if (Thread->lowPriority)
+ if (Thread->lowPriority)
{
Thread->SetPriority(19);
Thread->SetIOPriority(7);
@@ -138,10 +138,10 @@ void cThread::SetIOPriority(int priority)
bool cThread::Start(int s)
{
silent = s;
-
- if (!running)
+
+ if (!running)
{
- if (active)
+ if (active)
{
// Wait until the previous incarnation of this thread has completely ended
// before starting it newly:
@@ -151,15 +151,15 @@ bool cThread::Start(int s)
while (!running && active && RestartTimeout.Elapsed() < THREAD_STOP_TIMEOUT)
cCondWait::SleepMs(THREAD_STOP_SLEEP);
}
- if (!active)
+ if (!active)
{
active = running = true;
- if (pthread_create(&childTid, NULL, (void *(*) (void *))&StartThread, (void *)this) == 0)
+ if (pthread_create(&childTid, NULL, (void *(*) (void *))&StartThread, (void *)this) == 0)
{
pthread_detach(childTid); // auto-reap
}
- else
+ else
{
tell(0, "Error: Thread won't start");
active = running = false;
@@ -173,11 +173,11 @@ bool cThread::Start(int s)
bool cThread::Active(void)
{
- if (active)
+ if (active)
{
int err;
-
- if ((err = pthread_kill(childTid, 0)) != 0)
+
+ if ((err = pthread_kill(childTid, 0)) != 0)
{
if (err != ESRCH)
tell(0, "Error: Thread ...");
@@ -195,11 +195,11 @@ void cThread::Cancel(int WaitSeconds)
{
running = false;
- if (active && WaitSeconds > -1)
+ if (active && WaitSeconds > -1)
{
- if (WaitSeconds > 0)
+ if (WaitSeconds > 0)
{
- for (time_t t0 = time(NULL) + WaitSeconds; time(NULL) < t0; )
+ for (time_t t0 = time(NULL) + WaitSeconds; time(NULL) < t0; )
{
if (!Active())
return;
@@ -247,16 +247,16 @@ void cCondWait::SleepMs(int TimeoutMs)
bool cCondWait::Wait(int TimeoutMs)
{
pthread_mutex_lock(&mutex);
-
- if (!signaled)
+
+ if (!signaled)
{
- if (TimeoutMs)
+ if (TimeoutMs)
{
struct timespec abstime;
-
- if (absTime(&abstime, TimeoutMs) == success)
+
+ if (absTime(&abstime, TimeoutMs) == success)
{
- while (!signaled)
+ while (!signaled)
{
if (pthread_cond_timedwait(&cond, &mutex, &abstime) == ETIMEDOUT)
break;
@@ -266,11 +266,11 @@ bool cCondWait::Wait(int TimeoutMs)
else
pthread_cond_wait(&cond, &mutex);
}
-
+
bool r = signaled;
signaled = false;
pthread_mutex_unlock(&mutex);
-
+
return r;
}
@@ -299,7 +299,7 @@ cCondVar::~cCondVar()
void cCondVar::Wait(cMyMutex &Mutex)
{
- if (Mutex.locked)
+ if (Mutex.locked)
{
int locked = Mutex.locked;
Mutex.locked = 0; // have to clear the locked count here, as pthread_cond_wait
@@ -312,12 +312,12 @@ void cCondVar::Wait(cMyMutex &Mutex)
bool cCondVar::TimedWait(cMyMutex &Mutex, int TimeoutMs)
{
bool r = true; // true = condition signaled, false = timeout
-
+
if (Mutex.locked)
{
struct timespec abstime;
-
- if (absTime(&abstime, TimeoutMs) == success)
+
+ if (absTime(&abstime, TimeoutMs) == success)
{
int locked = Mutex.locked;
@@ -328,11 +328,11 @@ bool cCondVar::TimedWait(cMyMutex &Mutex, int TimeoutMs)
if (pthread_cond_timedwait(&cond, &Mutex.mutex, &abstime) == ETIMEDOUT)
r = false;
-
+
Mutex.locked = locked;
}
}
-
+
return r;
}
diff --git a/main.c b/main.c
index 795c998..cd38ece 100644
--- a/main.c
+++ b/main.c
@@ -115,15 +115,16 @@ int main(int argc, char** argv)
case 'c': if (argv[i+1]) confDir = argv[++i]; break;
case 'M': EpgdConfig.maintanance = yes; break;
case 'u': doValidateAlterDatabase = yes; break;
- case 'i': if (argv[i+1])
+ case 'i':
{
- cSystemNotification::setPidFile(argv[++i]);
+ if (argv[i+1])
+ cSystemNotification::setPidFile(argv[++i]);
break;
}
- case 'p': if (argv[i+1])
+ case 'p':
{
- sstrcpy(EpgdConfig.pluginPath, argv[++i],
- sizeof(EpgdConfig.pluginPath));
+ if (argv[i+1])
+ sstrcpy(EpgdConfig.pluginPath, argv[++i], sizeof(EpgdConfig.pluginPath));
break;
}
case 'l':