summaryrefslogtreecommitdiff
path: root/command/marks.cpp
diff options
context:
space:
mode:
authorJochen Dolze <vdr@dolze.de>2010-08-19 18:51:20 +0200
committerJochen Dolze <vdr@dolze.de>2010-08-19 18:51:20 +0200
commit03fc6351fce571b5ff7454bdfad9d4a0f0fb7679 (patch)
tree038d58a27db9a010ebbfacc38e8a1e27a3b7d351 /command/marks.cpp
parent032f8437299515c83a0fe148e66c0230d0dad8fa (diff)
downloadvdr-plugin-markad-03fc6351fce571b5ff7454bdfad9d4a0f0fb7679.tar.gz
vdr-plugin-markad-03fc6351fce571b5ff7454bdfad9d4a0f0fb7679.tar.bz2
Added code to distinguish between different index errors
Diffstat (limited to 'command/marks.cpp')
-rw-r--r--command/marks.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/command/marks.cpp b/command/marks.cpp
index 529467b..5c9e25e 100644
--- a/command/marks.cpp
+++ b/command/marks.cpp
@@ -372,10 +372,10 @@ void clMarks::CloseIndex(const char *Directory, bool isTS)
indexfd=-1;
}
-bool clMarks::CheckIndex(const char *Directory, bool isTS, int FrameCnt, bool *IndexError)
+bool clMarks::CheckIndex(const char *Directory, bool isTS, int FrameCnt, int *IndexError)
{
if (!IndexError) return false;
- *IndexError=false;
+ *IndexError=0;
if (!first) return true;
@@ -386,7 +386,7 @@ bool clMarks::CheckIndex(const char *Directory, bool isTS, int FrameCnt, bool *I
free(ipath);
if (fd==-1)
{
- *IndexError=true;
+ *IndexError=IERR_NOTFOUND;
return true;
}
@@ -406,7 +406,7 @@ bool clMarks::CheckIndex(const char *Directory, bool isTS, int FrameCnt, bool *I
}
if (framecnt!=FrameCnt)
{
- *IndexError=true;
+ *IndexError=IERR_TOOSHORT;
close(fd);
return true;
}
@@ -421,18 +421,18 @@ bool clMarks::CheckIndex(const char *Directory, bool isTS, int FrameCnt, bool *I
off_t offset = mark->position * sizeof(struct tIndexTS);
if (lseek(fd,offset,SEEK_SET)!=offset)
{
- *IndexError=true;
+ *IndexError=IERR_SEEK;
break;
}
struct tIndexTS IndexTS;
if (read(fd,&IndexTS,sizeof(IndexTS))!=sizeof(IndexTS))
{
- *IndexError=true;
+ *IndexError=IERR_READ;
break;
}
if (!IndexTS.independent)
{
- *IndexError=true;
+ *IndexError=IERR_FRAME;
break;
}
}
@@ -441,18 +441,18 @@ bool clMarks::CheckIndex(const char *Directory, bool isTS, int FrameCnt, bool *I
off_t offset = mark->position * sizeof(struct tIndexVDR);
if (lseek(fd,offset,SEEK_SET)!=offset)
{
- *IndexError=true;
+ *IndexError=IERR_SEEK;
break;
}
struct tIndexVDR IndexVDR;
if (read(fd,&IndexVDR,sizeof(IndexVDR))!=sizeof(IndexVDR))
{
- *IndexError=true;
+ *IndexError=IERR_READ;
break;
}
if (IndexVDR.type!=1)
{
- *IndexError=true;
+ *IndexError=IERR_FRAME;
break;
}
}