summaryrefslogtreecommitdiff
path: root/tools.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2000-10-08 09:25:20 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2000-10-08 09:25:20 +0200
commit97c3bb61482855769f0208062610543475f02006 (patch)
tree98ed285302e4b4a9fcc6186587b2da234776ec14 /tools.c
parent60958ab1323d4f4750338165b89a99f4f2fbe4a7 (diff)
downloadvdr-97c3bb61482855769f0208062610543475f02006.tar.gz
vdr-97c3bb61482855769f0208062610543475f02006.tar.bz2
Remote control uses threads
Diffstat (limited to 'tools.c')
-rw-r--r--tools.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/tools.c b/tools.c
index 5bb56e6d..fc15a985 100644
--- a/tools.c
+++ b/tools.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: tools.c 1.20 2000/09/29 16:19:28 kls Exp $
+ * $Id: tools.c 1.21 2000/10/07 18:02:24 kls Exp $
*/
#define _GNU_SOURCE
@@ -393,6 +393,22 @@ bool cFile::AnyFileReady(int FileDes, int TimeoutMs)
return select(FD_SETSIZE, &set, NULL, NULL, &timeout) > 0 && (FileDes < 0 || FD_ISSET(FileDes, &set));
}
+bool cFile::FileReady(int FileDes, int TimeoutMs)
+{
+#ifdef DEBUG_OSD
+ refresh();
+#endif
+ fd_set set;
+ struct timeval timeout;
+ FD_ZERO(&set);
+ FD_SET(FileDes, &set);
+ if (TimeoutMs < 100)
+ TimeoutMs = 100;
+ timeout.tv_sec = 0;
+ timeout.tv_usec = TimeoutMs * 1000;
+ return select(FD_SETSIZE, &set, NULL, NULL, &timeout) > 0 && FD_ISSET(FileDes, &set);
+}
+
// --- cListObject -----------------------------------------------------------
cListObject::cListObject(void)