From 6b360d8b0401bf3337b1b4f70e0bf630abdc421b Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Fri, 25 Feb 2022 23:50:38 -0500 Subject: action.c keyremap clean-up add logf to core_keymap.c move the remap out of the loop and eliminate a status flag Change-Id: I9ab841037a8ea7dff736b452ff55e8242084af82 --- apps/core_keymap.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'apps/core_keymap.c') diff --git a/apps/core_keymap.c b/apps/core_keymap.c index 131c48f45d..dbe7ae0072 100644 --- a/apps/core_keymap.c +++ b/apps/core_keymap.c @@ -23,6 +23,9 @@ #include "core_alloc.h" #include "core_keymap.h" +/*#define LOGF_ENABLE*/ +#include "logf.h" + #if !defined(__PCTOOL__) || defined(CHECKWPS) static int keymap_handle = -1; @@ -76,6 +79,7 @@ int core_load_key_remap(const char *filename) if (core_alloc_keymap(fsize) <= 0) { count = -30; + logf("core_keymap: %d Failed to allocate buffer", count); break; } buf = core_get_data(keymap_handle); @@ -84,7 +88,10 @@ int core_load_key_remap(const char *filename) count = action_set_keymap((struct button_mapping *) buf, count); } else + { count = -40; + logf("core_keymap: %d Failed to read", count); + } break; } close(fd); @@ -108,6 +115,7 @@ int open_key_remap(const char *filename, int *fd, size_t *fsize) if (count * sizeof(struct button_mapping) != *fsize) { count = -10; + logf("core_keymap: %d Size mismatch", count); break; } @@ -125,6 +133,7 @@ int open_key_remap(const char *filename, int *fd, size_t *fsize) else /* Header mismatch */ { count = -20; + logf("core_keymap: %d Header mismatch", count); break; } } -- cgit v1.2.3