From bbe24e4e622f8f77e63724b4d624b0a7dc0c7d12 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Thu, 6 Jan 2005 16:46:18 +0100 Subject: [PATCH] Fixed a possible race condition in cDevice::Action() --- CONTRIBUTORS | 1 + HISTORY | 1 + device.c | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 93a2b102..fc6b5a22 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -1160,6 +1160,7 @@ Lucian Muresan Mattias Grönlund for pointing out a missing cleanup at program exit in case there is a problem with a plugin + for fixing possible race condition in cDevice::Action() Uwe Hanke for fixing some typos in the Makefile's 'font' target diff --git a/HISTORY b/HISTORY index dded5cb1..a787e333 100644 --- a/HISTORY +++ b/HISTORY @@ -3275,3 +3275,4 @@ Video Disk Recorder Revision History Currently there is no visual indicator of the audio channel, yet, and it doesn't work with the selected audio languages. It also doesn't appear to work with some DVB cards (esp. the Siemens DVB-S Rev 1.3). +- Fixed a possible race condition in cDevice::Action() (thanks to Mattias Grönlund). diff --git a/device.c b/device.c index e217ceb3..390cf92f 100644 --- a/device.c +++ b/device.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.c 1.69 2005/01/06 14:56:08 kls Exp $ + * $Id: device.c 1.70 2005/01/06 16:45:12 kls Exp $ */ #include "device.h" @@ -976,8 +976,8 @@ bool cDevice::Receiving(bool CheckAny) const void cDevice::Action(void) { + active = true; if (OpenDvr()) { - active = true; for (; active;) { // Read data from the DVR device: uchar *b = NULL;