Fixed cPoller::Poll() to allow negative timeout values again

This commit is contained in:
Klaus Schmidinger
2025-06-23 09:23:05 +02:00
parent 591085812d
commit 6f0305a95d
2 changed files with 8 additions and 2 deletions

View File

@@ -10137,3 +10137,7 @@ Video Disk Recorder Revision History
- Fixed Channel+/Channel- keys stopping replay of a recording. - Fixed Channel+/Channel- keys stopping replay of a recording.
- Fixed an invalid lock sequence when pressing the Channel+/Channel- keys while in the - Fixed an invalid lock sequence when pressing the Channel+/Channel- keys while in the
"What's on..." menu in live view. "What's on..." menu in live view.
2025-06-23:
- Fixed cPoller::Poll() to allow negative timeout values again.

View File

@@ -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: tools.c 5.17 2025/06/18 08:44:47 kls Exp $ * $Id: tools.c 5.18 2025/06/23 09:23:05 kls Exp $
*/ */
#include "tools.h" #include "tools.h"
@@ -1585,7 +1585,9 @@ void cPoller::Del(int FileHandle, bool Out)
bool cPoller::Poll(int TimeoutMs) bool cPoller::Poll(int TimeoutMs)
{ {
if (numFileHandles) { if (numFileHandles) {
if (poll(pfd, numFileHandles, max(TimeoutMs, 3)) != 0) // can't let it be 0, otherwise poll() returns immediately, even if no file descriptors are ready if (TimeoutMs == 0)
TimeoutMs = 1; // can't let it be 0, otherwise poll() returns immediately, even if no file descriptors are ready
if (poll(pfd, numFileHandles, TimeoutMs) != 0)
return true; // returns true even in case of an error, to let the caller return true; // returns true even in case of an error, to let the caller
// access the file and thus see the error code // access the file and thus see the error code
} }