summaryrefslogtreecommitdiff
path: root/recording.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2003-05-24 11:22:34 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2003-05-24 11:22:34 +0200
commit743a3ec12327fa8c86bce73d5c47b70b6c187194 (patch)
tree2d2202e11b647eb5ed75f6cb4ac260bcc0faa41c /recording.c
parent38fbbb469d7cb67af27a5fc5cd0bdd4c747ca9ff (diff)
downloadvdr-743a3ec12327fa8c86bce73d5c47b70b6c187194.tar.gz
vdr-743a3ec12327fa8c86bce73d5c47b70b6c187194.tar.bz2
Fixed resume file handling in case the resume.vdr file can't be written
Diffstat (limited to 'recording.c')
-rw-r--r--recording.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/recording.c b/recording.c
index 9105157a..7e68a791 100644
--- a/recording.c
+++ b/recording.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: recording.c 1.78 2003/05/18 15:17:45 kls Exp $
+ * $Id: recording.c 1.79 2003/05/24 11:22:34 kls Exp $
*/
#include "recording.h"
@@ -169,6 +169,11 @@ int cResumeFile::Read(void)
{
int resume = -1;
if (fileName) {
+ struct stat st;
+ if (stat(fileName, &st) == 0) {
+ if ((st.st_mode & S_IWUSR) == 0) // no write access, assume no resume
+ return -1;
+ }
int f = open(fileName, O_RDONLY);
if (f >= 0) {
if (safe_read(f, &resume, sizeof(resume)) != sizeof(resume)) {