mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Fixed resume file handling in case the resume.vdr file can't be written
This commit is contained in:
parent
38fbbb469d
commit
743a3ec123
@ -506,6 +506,7 @@ Gerhard Steiner <steiner@mail.austria.com>
|
|||||||
records as a newline character
|
records as a newline character
|
||||||
for reporting a bug in displaying messages in the status line in case they exceed
|
for reporting a bug in displaying messages in the status line in case they exceed
|
||||||
the OSD width
|
the OSD width
|
||||||
|
for fixing resume file handling in case the resume.vdr file can't be written
|
||||||
|
|
||||||
Jaakko Hyvätti <jaakko@hyvatti.iki.fi>
|
Jaakko Hyvätti <jaakko@hyvatti.iki.fi>
|
||||||
for translating OSD texts to the Finnish language
|
for translating OSD texts to the Finnish language
|
||||||
|
2
HISTORY
2
HISTORY
@ -2182,3 +2182,5 @@ Video Disk Recorder Revision History
|
|||||||
- Completed the Finnish OSD texts (thanks to Niko Tarnanen and Rolf Ahrenberg).
|
- Completed the Finnish OSD texts (thanks to Niko Tarnanen and Rolf Ahrenberg).
|
||||||
- Fixed I/O handling in case an explicit controlling terminal is given (thanks
|
- Fixed I/O handling in case an explicit controlling terminal is given (thanks
|
||||||
to Oliver Endriss).
|
to Oliver Endriss).
|
||||||
|
- Fixed resume file handling in case the resume.vdr file can't be written
|
||||||
|
(thanks to Gerhard Steiner).
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* 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"
|
#include "recording.h"
|
||||||
@ -169,6 +169,11 @@ int cResumeFile::Read(void)
|
|||||||
{
|
{
|
||||||
int resume = -1;
|
int resume = -1;
|
||||||
if (fileName) {
|
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);
|
int f = open(fileName, O_RDONLY);
|
||||||
if (f >= 0) {
|
if (f >= 0) {
|
||||||
if (safe_read(f, &resume, sizeof(resume)) != sizeof(resume)) {
|
if (safe_read(f, &resume, sizeof(resume)) != sizeof(resume)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user