--- vdr-1.0.0.orig/dvbapi.c 2002-04-07 11:35:51.000000000 +0200 +++ vdr-1.0.0.orig/dvbapi.c 2005-01-16 15:41:39.000000000 +0100 @@ -1987,8 +1987,10 @@ bool cDvbApi::GrabImage(const char *File Quality = 255; //XXX is this 'best'??? isyslog(LOG_INFO, "grabbing to %s (%s %d %d %d)", FileName, Jpeg ? "JPEG" : "PNM", Quality, vm.width, vm.height); - FILE *f = fopen(FileName, "wb"); - if (f) { + int fd = open(FileName, O_CREAT | O_EXCL | O_TRUNC | O_RDWR, 0600); + if (fd > -1) { + FILE *f = fdopen(fd, "wb"); + if (f) { if (Jpeg) { // write JPEG file: struct jpeg_compress_struct cinfo; @@ -2022,7 +2024,8 @@ bool cDvbApi::GrabImage(const char *File } } fclose(f); - } + } + } else { LOG_ERROR_STR(FileName); result |= 1;