From 4e4ef7ed69652e34d1dde3332b9b394eaaa9ba29 Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Sat, 5 Oct 2013 18:41:44 +0200 Subject: fixed detection of errors and refactored code when sending non-raw keys, errors were reported on success and failures were ignored --- inputdev.cc | 8 +++----- 1 file 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", -- cgit v1.2.3