summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2006-03-19 14:36:43 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2006-03-19 14:36:43 +0100
commit7bba79ef0a2fe6055c6874fdba2d302c8ba3ad5a (patch)
treeb60db53fddb294e1651e22c0ed7314f3c76457b0
parentcf1941ca0195829b6865de778bc24d12eb9b77d7 (diff)
downloadvdr-7bba79ef0a2fe6055c6874fdba2d302c8ba3ad5a.tar.gz
vdr-7bba79ef0a2fe6055c6874fdba2d302c8ba3ad5a.tar.bz2
Fixed deleting recordings that have been removed externally when running out of disk space
-rw-r--r--CONTRIBUTORS4
-rw-r--r--HISTORY2
-rw-r--r--recording.c13
3 files changed, 15 insertions, 4 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 2b3641c8..80349ed2 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -1781,3 +1781,7 @@ Pekka Mauno <pekka.mauno@iki.fi>
Alexander Wenzel <hondansx@gmx.de>
for fixing the shutdown timeout
+
+Jan Lenz <email@JanLenz.de>
+ for reporting a bug in deleting recordings that have been removed externally when
+ running out of disk space
diff --git a/HISTORY b/HISTORY
index c03e27c9..a7651cba 100644
--- a/HISTORY
+++ b/HISTORY
@@ -4432,3 +4432,5 @@ Video Disk Recorder Revision History
- Fixed the shutdown timeout (thanks to Alexander Wenzel).
- Only calling RemoveEmptyVideoDirectories() once in case a recording has been
deleted (reported by Hardy Flor).
+- Fixed deleting recordings that have been removed externally when running out of
+ disk space (reported by Jan Lenz).
diff --git a/recording.c b/recording.c
index 6c1692b8..55ab9396 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.141 2006/03/19 14:08:58 kls Exp $
+ * $Id: recording.c 1.142 2006/03/19 14:33:18 kls Exp $
*/
#include "recording.h"
@@ -804,11 +804,16 @@ bool cRecording::Delete(void)
strncpy(ext, DELEXT, strlen(ext));
if (access(NewName, F_OK) == 0) {
// the new name already exists, so let's remove that one first:
- isyslog("removing recording %s", NewName);
+ isyslog("removing recording '%s'", NewName);
RemoveVideoFile(NewName);
}
- isyslog("deleting recording %s", FileName());
- result = RenameVideoFile(FileName(), NewName);
+ isyslog("deleting recording '%s'", FileName());
+ if (access(FileName(), F_OK) == 0)
+ result = RenameVideoFile(FileName(), NewName);
+ else {
+ isyslog("recording '%s' vanished", FileName());
+ result = true; // well, we were going to delete it, anyway
+ }
}
free(NewName);
return result;