diff options
author | Leah Rowe <leah@libreboot.org> | 2025-01-29 04:10:52 +0000 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2025-01-29 04:10:52 +0000 |
commit | 8a435355135daf19040fcc6b02e6570d918958fd (patch) | |
tree | 7ea59092bd8e50fd2081c907212d9fa4319b46db | |
parent | a65a0c2f963491798d82d5012bcf09e40538a34c (diff) |
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>
-rw-r--r-- | util/nvmutil/nvmutil.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index b8319a0d..b016e419 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -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); } |