util/nvmutil: dont report bad size if /dev/urandom

fsdg20230625
Leah Rowe 2022-12-03 12:00:25 +00:00
parent ededa5ddda
commit e5a46b464d
1 changed files with 1 additions and 1 deletions

View File

@ -142,7 +142,7 @@ readFromFile(int *fd, uint8_t *buf, const char *path, int flags, size_t size)
return -1;
} else if (size == SIZE_8KB) {
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");
errno = ECANCELED;
return -1;