util/nvmutil: Fix bad comparison

We're checking if errno is ENOTDIR, not setting it;
the previous code would always return true, and then
set errno 0, which in the context of this code was
actually OK, so this patch makes no functional difference
in practise.

However, I'm a stickler for technical correctness. I caught
this when trying to compile with clang, because clang is
quite pedantic about checking for exactly this type of bug.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2025-01-29 04:10:52 +00:00
parent a65a0c2f96
commit 8a43535513
+1 -1
View File
@@ -182,7 +182,7 @@ checkdir(const char *path)
{
if (opendir(path) != NULL)
err(errno = EISDIR, "%s", path);
if (errno = ENOTDIR)
if (errno == ENOTDIR)
errno = 0;
err_if(errno);
}