diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2006-03-19 14:36:43 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2006-03-19 14:36:43 +0100 |
commit | 7bba79ef0a2fe6055c6874fdba2d302c8ba3ad5a (patch) | |
tree | b60db53fddb294e1651e22c0ed7314f3c76457b0 /recording.c | |
parent | cf1941ca0195829b6865de778bc24d12eb9b77d7 (diff) | |
download | vdr-7bba79ef0a2fe6055c6874fdba2d302c8ba3ad5a.tar.gz vdr-7bba79ef0a2fe6055c6874fdba2d302c8ba3ad5a.tar.bz2 |
Fixed deleting recordings that have been removed externally when running out of disk space
Diffstat (limited to 'recording.c')
-rw-r--r-- | recording.c | 13 |
1 files changed, 9 insertions, 4 deletions
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; |