#include <pepper-utils.h>
#include <unistd.h>
#include <stdio.h>
+#include <errno.h>
#define MIN(a,b) ((a)<(b)?(a):(b))
pepper_keyrouter->opts = (key_options_t *)calloc(KEYROUTER_MAX_KEYS, sizeof(key_options_t));
PEPPER_CHECK(pepper_keyrouter->opts, return, "Failed to alloc memory for options\n") ;
- if (access(KEYLAYOUT_DIR, R_OK) != 0) {
- PEPPER_ERROR("Failed to access key layout file(%s)\n", KEYLAYOUT_DIR);
- goto finish;
- }
-
file = fopen(KEYLAYOUT_DIR, "r");
- PEPPER_CHECK(file, goto finish, "Failed to open key layout file(%s)\n", KEYLAYOUT_DIR);
+ PEPPER_CHECK(file, goto finish, "Failed to open key layout file(%s): (errno: %s)\n", KEYLAYOUT_DIR, strerror(errno));
while (!feof(file)) {
ret = fgets(buf, 1024, file);