From 4d76dbf911e866187829e28a57791abaa652519d Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 13 Aug 2014 18:44:43 +0200 Subject: m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-kkbd.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/mds-kkbd.c b/src/mds-kkbd.c index cb0b3c3..0d72093 100644 --- a/src/mds-kkbd.c +++ b/src/mds-kkbd.c @@ -1006,18 +1006,14 @@ static int remap(char* table, size_t n) */ int handle_keycode_map(const char* recv_action, const char* recv_keyboard) { - int r; + int r = 0; if ((recv_keyboard != NULL) && !strequals(recv_keyboard, KEYBOARD_ID)) return 0; if (recv_action == NULL) - { - eprint("received keycode map request but without any action, ignoring."); - return 0; - } - - if (strequals(recv_action, "remap")) + eprint("received keycode map request but without any action, ignoring."); + else if (strequals(recv_action, "remap")) { if (received.payload_size == 0) { @@ -1028,7 +1024,6 @@ int handle_keycode_map(const char* recv_action, const char* recv_keyboard) with_mutex (mapping_mutex, r = remap(received.payload, received.payload_size); ); - return r; } else if (strequals(recv_action, "reset")) { @@ -1036,14 +1031,14 @@ int handle_keycode_map(const char* recv_action, const char* recv_keyboard) free(mapping); mapping_size = 0; ); - return 0; } else if (strequals(recv_action, "query")) /* FIXME */ { } + else + eprint("received keycode map request with invalid action, ignoring."); - eprint("received keycode map request with invalid action, ignoring."); - return 0; + return r; } -- cgit v1.2.3-70-g09d2