diff options
author | Leah Rowe <leah@libreboot.org> | 2022-12-03 12:00:25 +0000 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2022-12-03 12:00:25 +0000 |
commit | e5a46b464d10f746c8caf68c2e245c7e78b92b4c (patch) | |
tree | de7bc4b3813011dd7197e7bd60983d3cdd41e9ef /util/nvmutil/nvmutil.c | |
parent | ededa5dddac36bdae4254b3ea6e8c51737c97a68 (diff) |
util/nvmutil: dont report bad size if /dev/urandom
Diffstat (limited to 'util/nvmutil/nvmutil.c')
-rw-r--r-- | util/nvmutil/nvmutil.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |