util/nvmutil file reads: skip reading if errno!=0
*This condition will probably never be met, but it is theoretically possible that the code could still fail at this point. Catch all errors, and exit, ruthlessly.fsdg20230625
parent
27876c6421
commit
17fa25e5af
|
@ -154,6 +154,8 @@ readFromFile(int *fd, uint8_t *buf, const char *path, int flags, size_t size)
|
||||||
|
|
||||||
if (errno == ENOTDIR)
|
if (errno == ENOTDIR)
|
||||||
errno = 0;
|
errno = 0;
|
||||||
|
else if (errno != 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
return read((*fd), buf, size);
|
return read((*fd), buf, size);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue