summaryrefslogtreecommitdiff
path: root/tools.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2001-06-02 10:47:40 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2001-06-02 10:47:40 +0200
commitc40e4eb96e43963845d1de1678a317b27e77f04e (patch)
treefc61866ba83db4bb0611cb45f1bd951eeeb56bd7 /tools.c
parent1ef2b1d3a149348539565902825bb168a52673a1 (diff)
downloadvdr-c40e4eb96e43963845d1de1678a317b27e77f04e.tar.gz
vdr-c40e4eb96e43963845d1de1678a317b27e77f04e.tar.bz2
Converted to the new API plus several small enhancements0.8.0
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 5a3730d3..de1a52c3 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.33 2001/04/22 10:31:29 kls Exp $
+ * $Id: tools.c 1.34 2001/05/20 08:30:54 kls Exp $
*/
#define _GNU_SOURCE
@@ -411,6 +411,22 @@ bool cFile::FileReady(int FileDes, int TimeoutMs)
return select(FD_SETSIZE, &set, NULL, NULL, &timeout) > 0 && FD_ISSET(FileDes, &set);
}
+bool cFile::FileReadyForWriting(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, NULL, &set, NULL, &timeout) > 0 && FD_ISSET(FileDes, &set);
+}
+
// --- cSafeFile -------------------------------------------------------------
cSafeFile::cSafeFile(const char *FileName)