fix: resolve cppcheck shadow/always-true findings

This commit is contained in:
2026-09-21 21:28:36 +02:00
parent 8d46a26c04
commit 338c27db73
2 changed files with 5 additions and 7 deletions
+3 -3
View File
@@ -141,9 +141,9 @@ static FILE* secret_file_open(const char* path, char* err, size_t err_size) {
* most systems, but explicit. Failures here are ignored: O_NONBLOCK on a
* regular file does not affect reads either way. */
if (S_ISREG(st.st_mode)) {
int flags = fcntl(fd, F_GETFL);
if (flags >= 0)
(void)fcntl(fd, F_SETFL, flags & ~O_NONBLOCK);
int status_flags = fcntl(fd, F_GETFL);
if (status_flags >= 0)
(void)fcntl(fd, F_SETFL, status_flags & ~O_NONBLOCK);
}
FILE* fp = fdopen(fd, "r");
if (!fp) {