diff options
author | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2000-07-15 18:00:00 +0200 |
---|---|---|
committer | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2000-07-15 18:00:00 +0200 |
commit | 3b78ec8374aac8daa560fa0cd06260fca6eb1500 (patch) | |
tree | e753b7fb9304a47651926ce1db67f83127b510fb /tools.c | |
parent | 9599a8fd8a6724e55ec4ad2ba2c975c0850073d9 (diff) | |
download | vdr-patch-lnbsharing-3b78ec8374aac8daa560fa0cd06260fca6eb1500.tar.gz vdr-patch-lnbsharing-3b78ec8374aac8daa560fa0cd06260fca6eb1500.tar.bz2 |
Version 0.06vdr-0.06
- Added support for LIRC remote control (thanks to Carsten Koch!).
There are now three different remote control modes: KBD (PC-Keyboard), RCU
and LIRC. See the INSTALL file for information on how to enable either of
these modes. The default mode is now KBD, not RCU as before (to make it
work immediately even if there is no actual remote control).
Diffstat (limited to 'tools.c')
-rw-r--r-- | tools.c | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: tools.c 1.7 2000/04/24 15:01:35 kls Exp $ + * $Id: tools.c 1.8 2000/06/24 15:26:15 kls Exp $ */ #define _GNU_SOURCE @@ -22,15 +22,18 @@ int SysLogLevel = 3; -bool DataAvailable(int filedes) +bool DataAvailable(int filedes, bool wait) { - fd_set set; - FD_ZERO(&set); - FD_SET(filedes, &set); - struct timeval timeout; - timeout.tv_sec = 0; - timeout.tv_usec = 10000; - return select(FD_SETSIZE, &set, NULL, NULL, &timeout) > 0 && FD_ISSET(filedes, &set); + if (filedes >= 0) { + fd_set set; + FD_ZERO(&set); + FD_SET(filedes, &set); + struct timeval timeout; + timeout.tv_sec = wait ? 1 : 0; + timeout.tv_usec = wait ? 0 : 10000; + return select(FD_SETSIZE, &set, NULL, NULL, &timeout) > 0 && FD_ISSET(filedes, &set); + } + return false; } void writechar(int filedes, char c) |