[PATCH kanshi] Reset errno before calling fgetc
Export this patch
kanshi might fail to reload configuration with EAGAIN here.
This is because fgetc only sets errno when error occurred, but won't
clear errno when there's no error.
---
parser.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/parser.c b/parser.c
index 5b774d9..1853ff7 100644
--- a/parser.c
+++ b/parser.c
@@ -33,6 +33,7 @@ static int parser_read_char(struct kanshi_parser *parser) {
return ch;
}
+ errno = 0;
int ch = fgetc(parser->f);
if (ch == EOF) {
if (errno != 0) {
--
2.40.0
kanshi/patches/.build.yml: SUCCESS in 30s
[Reset errno before calling fgetc][0] from [ookami][1]
[0]: https://lists.sr.ht/~emersion/public-inbox/patches/40292
[1]: mailto:mail@ookami.one
✓ #971461 SUCCESS kanshi/patches/.build.yml https://builds.sr.ht/~emersion/job/971461
Good catch! Pushed, thanks for the fix.