mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 14:02:52 +02:00
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.
This commit is contained in:
@@ -154,6 +154,8 @@ readFromFile(int *fd, uint8_t *buf, const char *path, int flags, size_t size)
|
||||
|
||||
if (errno == ENOTDIR)
|
||||
errno = 0;
|
||||
else if (errno != 0)
|
||||
return -1;
|
||||
|
||||
return read((*fd), buf, size);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user