summaryrefslogtreecommitdiff
path: root/command/markad-standalone.cpp
diff options
context:
space:
mode:
authorJochen Dolze <vdr@dolze.de>2011-02-22 22:03:20 +0100
committerJochen Dolze <vdr@dolze.de>2011-02-22 22:03:20 +0100
commit5782601e3657aac1edde30746f82de8c70a905bd (patch)
treed7b3ac8d0f30a7bdd1876592d472690d147fa669 /command/markad-standalone.cpp
parent39d416b9b484981a5ef547fcee1060166aa0c1b2 (diff)
downloadvdr-plugin-markad-5782601e3657aac1edde30746f82de8c70a905bd.tar.gz
vdr-plugin-markad-5782601e3657aac1edde30746f82de8c70a905bd.tar.bz2
Got rid of backupmarks plugin optiondevel
Fixed noatime detection in GetBroadcastStart
Diffstat (limited to 'command/markad-standalone.cpp')
-rw-r--r--command/markad-standalone.cpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/command/markad-standalone.cpp b/command/markad-standalone.cpp
index 51e4950..f99ae92 100644
--- a/command/markad-standalone.cpp
+++ b/command/markad-standalone.cpp
@@ -1368,23 +1368,36 @@ time_t cMarkAdStandalone::GetBroadcastStart(time_t start, int fd)
struct mntent *ent;
struct stat statbuf;
FILE *mounts=setmntent(_PATH_MOUNTED,"r");
+ int mlen=0;
+ int oldmlen=0;
+ bool useatime=false;
while ((ent=getmntent(mounts))!=NULL)
{
if (strstr(directory,ent->mnt_dir))
{
- if (strstr(ent->mnt_opts,"noatime"))
+ mlen=strlen(ent->mnt_dir);
+ if (mlen>oldmlen)
{
- if (stat(directory,&statbuf)!=-1)
+ if (strstr(ent->mnt_opts,"noatime"))
{
- endmntent(mounts);
- isyslog("getting broadcast start from directory atime");
- return statbuf.st_atime;
+ useatime=true;
+ }
+ else
+ {
+ useatime=false;
}
}
+ oldmlen=mlen;
}
}
endmntent(mounts);
+ if ((useatime) && (stat(directory,&statbuf)!=-1))
+ {
+ isyslog("getting broadcast start from directory atime");
+ return statbuf.st_atime;
+ }
+
// try to get from mtime
// (and hope info.vdr has not changed after the start of the recording)
if (fstat(fd,&statbuf)!=-1)