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>master
parent
a70ab825b9
commit
438ebb1647
util/nvmutil
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue