diff options
author | Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> | 2013-10-05 18:41:44 +0200 |
---|---|---|
committer | Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> | 2013-10-06 15:36:58 +0200 |
commit | 4e4ef7ed69652e34d1dde3332b9b394eaaa9ba29 (patch) | |
tree | ce7fe896a459765576cdb186eeef95d3f5102a9d | |
parent | 30ee4dbe03b983aa14ae9bd93df85eb187913003 (diff) | |
download | vdr-plugin-inputdev-4e4ef7ed69652e34d1dde3332b9b394eaaa9ba29.tar.gz vdr-plugin-inputdev-4e4ef7ed69652e34d1dde3332b9b394eaaa9ba29.tar.bz2 |
fixed detection of errors and refactored code
when sending non-raw keys, errors were reported on success and failures
were ignored
-rw-r--r-- | inputdev.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/inputdev.cc b/inputdev.cc index 70d883b..7efdeba 100644 --- a/inputdev.cc +++ b/inputdev.cc @@ -582,12 +582,10 @@ void cInputDevice::handle_pollin(void) return; } - if (is_raw && !controller_.PutRaw(code, is_repeated, is_released)) - rc = -1; - else if (!is_raw && controller_.Put(code, is_repeated, is_released)) - rc = -1; + if (is_raw) + rc = controller_.PutRaw(code, is_repeated, is_released) ? 0 : -1; else - rc = 0; + rc = controller_.Put(code, is_repeated, is_released) ? 0 : -1; if (rc < 0) { esyslog("%s: failed to put [%02x,%04x,%u] event [%016" PRIX64 ", %d, %d\n", |