From d5e52bc81e7ed81227fb7d96e236db318400cb75 Mon Sep 17 00:00:00 2001 From: Andreas Franek Date: Sun, 9 Jan 2022 22:31:07 +0100 Subject: [PATCH] pigpio.c: reset errno after existance check (#509) --- pigpio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pigpio.c b/pigpio.c index 4c49d44..e3f04e4 100644 --- a/pigpio.c +++ b/pigpio.c @@ -7299,6 +7299,8 @@ static void initCheckLockFile(void) char str[20]; fd = open(PI_LOCKFILE, O_RDONLY); + if(errno == ENOENT) + errno = 0; // reset if expected error occured if (fd != -1) {