summaryrefslogtreecommitdiff
path: root/markad-standalone.cpp
diff options
context:
space:
mode:
authorJochen Dolze <vdr@dolze.de>2010-03-26 22:34:41 +0100
committerJochen Dolze <vdr@dolze.de>2010-03-26 22:34:41 +0100
commitb445c3bdbb6b222468052be12ee36422a99a8323 (patch)
tree77b1ecede26a2d7995b2e744b0eae60724a05096 /markad-standalone.cpp
parent80599de74daed049ba6d25cbf2644a8725fc4060 (diff)
downloadvdr-plugin-markad-b445c3bdbb6b222468052be12ee36422a99a8323.tar.gz
vdr-plugin-markad-b445c3bdbb6b222468052be12ee36422a99a8323.tar.bz2
Added plugin active check to prevent shutdown while markad is still working
Diffstat (limited to 'markad-standalone.cpp')
-rw-r--r--markad-standalone.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/markad-standalone.cpp b/markad-standalone.cpp
index 41d2992..6c07bfa 100644
--- a/markad-standalone.cpp
+++ b/markad-standalone.cpp
@@ -177,11 +177,10 @@ void cMarkAdStandalone::SaveFrame(int frame)
void cMarkAdStandalone::CheckIndex(const char *Directory)
{
- // Here we check the indexfile
- // if we have an index we check if the
- // index is more advanced than our framecounter
- // if not we wait. if we wait too much,
- // we discard this check
+ // Here we check if the index is more
+ // advanced than our framecounter.
+ // If not we wait. If we wait too much,
+ // we discard this check...
#define WAITTIME 10
@@ -436,7 +435,8 @@ void cMarkAdStandalone::Process(const char *Directory)
}
gettimeofday(&tv2,&tz);
- long sec,usec;
+ time_t sec;
+ suseconds_t usec;
sec=tv2.tv_sec-tv1.tv_sec;
usec=tv2.tv_usec-tv1.tv_usec;
if (usec<0)
@@ -757,11 +757,11 @@ bool cMarkAdStandalone::CreatePidfile(const char *Directory)
if (oldpid)
{
// found old pidfile, check if it's still running
- long pid;
- if (fscanf(oldpid,"%li\n",&pid)==1)
+ int pid;
+ if (fscanf(oldpid,"%i\n",&pid)==1)
{
char procname[256]="";
- snprintf(procname,sizeof(procname),"/proc/%li",pid);
+ snprintf(procname,sizeof(procname),"/proc/%i",pid);
struct stat statbuf;
if (stat(procname,&statbuf)!=-1)
{
@@ -793,7 +793,7 @@ bool cMarkAdStandalone::CreatePidfile(const char *Directory)
free(buf);
if (!pidfile) return false;
- fprintf(pidfile,"%li\n",(long) getpid());
+ fprintf(pidfile,"%i\n",(int) getpid());
fflush(pidfile);
fclose(pidfile);
return true;