From e5a46b464d10f746c8caf68c2e245c7e78b92b4c Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 3 Dec 2022 12:00:25 +0000 Subject: util/nvmutil: dont report bad size if /dev/urandom --- util/nvmutil/nvmutil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index acaf5a98..b5f4e864 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -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; -- cgit v1.2.1