Commit ce286601b0410f0daaeac19f6bcc8dd90c3944a8

Peter Hutterer 2020-07-07T10:16:25

context: log include paths for debugging Now that we're relying on various different include paths, let's log that ones we use and the ones we failed to use. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/context.c b/src/context.c
index fe24516..768fe5c 100644
--- a/src/context.c
+++ b/src/context.c
@@ -58,19 +58,28 @@ xkb_context_include_path_append(struct xkb_context *ctx, const char *path)
         goto err;
 
     err = stat(path, &stat_buf);
-    if (err != 0)
+    if (err != 0) {
+        err = errno;
         goto err;
-    if (!S_ISDIR(stat_buf.st_mode))
+    }
+    if (!S_ISDIR(stat_buf.st_mode)) {
+        err = ENOTDIR;
         goto err;
+    }
 
-    if (!check_eaccess(path, R_OK | X_OK))
+    if (!check_eaccess(path, R_OK | X_OK)) {
+        err = EACCES;
         goto err;
+    }
 
     darray_append(ctx->includes, tmp);
+    log_dbg(ctx, "Include path added: %s\n", tmp);
+
     return 1;
 
 err:
     darray_append(ctx->failed_includes, tmp);
+    log_dbg(ctx, "Include path failed: %s (%s)\n", tmp, strerror(err));
     return 0;
 }