From: Peter Hutterer Date: Tue, 7 Jul 2020 00:16:25 +0000 (+1000) Subject: context: log include paths for debugging X-Git-Tag: xkbcommon-1.0.0~64 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ce286601b0410f0daaeac19f6bcc8dd90c3944a8;p=platform%2Fupstream%2Flibxkbcommon.git 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 --- 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; }