Skip to contentSkip to conversation

libkeymap: fix double kbdfile open

PATCH Applied Sertonix 2 participants 2 messages May 17, 2024 – May 20, 2024

lore
Share & tools
lore

Sertonix

author
#0 lore raw

PATCH 1/1 libkeymap: fix double kbdfile open

976867c3a84 (Rewrite libkbdfile library) changed kbdfile_find to error when the file descriptor was already opened. Make sure kbdfile_find isn't called again when kbdfile is found in include_dirpath1.

---
 src/libkeymap/analyze.l | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/libkeymap/analyze.l +1 -1
index 9c4c747..dd94206 100644
@@ -177,7 +177,7 @@ find_standard_incl_file(struct lk_ctx *ctx, char *s, struct kbdfile *fp)
 	i--;
 	pathname = kbdfile_get_pathname(ctx->stack[i]);
 
-	if (kbdfile_find(s, include_dirpath1, include_suffixes, fp)) {
+	if (rc = kbdfile_find(s, include_dirpath1, include_suffixes, fp)) {
 		if ((rc = find_incl_file_near_fn(ctx, s, pathname, fp)) == -1)
 			return rc;
 	}
Signature · 1 line
2.45.1
#1 lore raw
Quoted 4 lines · Sertonix

976867c3a84 (Rewrite libkbdfile library) changed kbdfile_find to error when the file descriptor was already opened. Make sure kbdfile_find isn't called again when kbdfile is found in include_dirpath1.

Applied. Thanks!

Quoted 22 lines
---
 src/libkeymap/analyze.l | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/libkeymap/analyze.l +1 -1
index 9c4c747..dd94206 100644
@@ -177,7 +177,7 @@ find_standard_incl_file(struct lk_ctx *ctx, char *s, struct kbdfile *fp)
 	i--;
 	pathname = kbdfile_get_pathname(ctx->stack[i]);
 
-	if (kbdfile_find(s, include_dirpath1, include_suffixes, fp)) {
+	if (rc = kbdfile_find(s, include_dirpath1, include_suffixes, fp)) {
 		if ((rc = find_incl_file_near_fn(ctx, s, pathname, fp)) == -1)
 			return rc;
 	}
Signature · 1 line
2.45.1
Signature · 1 line
Rgrds, legion