summaryrefslogtreecommitdiff
path: root/lirc.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2003-04-25 13:46:56 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2003-04-25 13:46:56 +0200
commit6fc02ebd08ea07686d99db6b37c75a82f4c6e3d1 (patch)
tree91cdd8237ab9d53342ae92af16604819d5cc8ab8 /lirc.c
parenta54427e28da2d644ca061b0dbbc2bf3cb32bade5 (diff)
downloadvdr-6fc02ebd08ea07686d99db6b37c75a82f4c6e3d1.tar.gz
vdr-6fc02ebd08ea07686d99db6b37c75a82f4c6e3d1.tar.bz2
Fixed detecting broken connection to the LIRC daemon
Diffstat (limited to 'lirc.c')
-rw-r--r--lirc.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/lirc.c b/lirc.c
index b7f5b936..571e88c4 100644
--- a/lirc.c
+++ b/lirc.c
@@ -6,7 +6,7 @@
*
* LIRC support added by Carsten Koch <Carsten.Koch@icem.de> 2000-06-16.
*
- * $Id: lirc.c 1.4 2003/04/12 14:37:17 kls Exp $
+ * $Id: lirc.c 1.5 2003/04/25 13:45:15 kls Exp $
*/
#include "lirc.h"
@@ -64,13 +64,14 @@ void cLircRemote::Action(void)
bool ready = cFile::FileReady(f, timeout);
int ret = ready ? safe_read(f, buf, sizeof(buf)) : -1;
- if (ready) {
- if (ret <= 21) {
- esyslog("ERROR: lircd connection lost");
- close(f);
- f = -1;
- break;
- }
+ if (ready && ret <= 0 ) {
+ esyslog("ERROR: lircd connection lost");
+ close(f);
+ f = -1;
+ break;
+ }
+
+ if (ready && ret > 21) {
int count;
char KeyName[LIRC_KEY_BUF];
sscanf(buf, "%*x %x %29s", &count, KeyName); // '29' in '%29s' is LIRC_KEY_BUF-1!