mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-16 03:25:25 +02:00
util/nvmutil: move ENOTDIR check to function
This commit is contained in:
@@ -113,8 +113,6 @@ main(int argc, char *argv[])
|
|||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
else if (readFromFile(&fd, gbe, FILENAME, flags, SIZE_8KB) != SIZE_8KB)
|
else if (readFromFile(&fd, gbe, FILENAME, flags, SIZE_8KB) != SIZE_8KB)
|
||||||
goto nvmutil_exit;
|
goto nvmutil_exit;
|
||||||
else if (errno == ENOTDIR)
|
|
||||||
errno = 0;
|
|
||||||
|
|
||||||
if (errno != 0)
|
if (errno != 0)
|
||||||
goto nvmutil_exit;
|
goto nvmutil_exit;
|
||||||
@@ -172,6 +170,8 @@ readFromFile(int *fd, uint8_t *buf, const char *path, int flags, size_t size)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (errno == ENOTDIR)
|
||||||
|
errno = 0;
|
||||||
return read((*fd), buf, size);
|
return read((*fd), buf, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user