mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-18 04:22:15 +02:00
util/nvmutil: dont report bad size if /dev/urandom
This commit is contained in:
@@ -142,7 +142,7 @@ readFromFile(int *fd, uint8_t *buf, const char *path, int flags, size_t size)
|
|||||||
return -1;
|
return -1;
|
||||||
} else if (size == SIZE_8KB) {
|
} else if (size == SIZE_8KB) {
|
||||||
fstat((*fd), &st);
|
fstat((*fd), &st);
|
||||||
if (st.st_size != SIZE_8KB) {
|
if ((st.st_size != SIZE_8KB) && strcmp(path, "/dev/urandom")) {
|
||||||
fprintf(stderr, "Bad file size\n");
|
fprintf(stderr, "Bad file size\n");
|
||||||
errno = ECANCELED;
|
errno = ECANCELED;
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user