summaryrefslogtreecommitdiff
path: root/util/nvmutil/nvmutil.c
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-03 19:53:09 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-03 19:53:09 +0000
commitfd515e4c2845abe55b5ef1ae7096ec149f8c483c (patch)
tree09ad10a92ab0bdc70adbab83a5418cc79229fcbf /util/nvmutil/nvmutil.c
parentf4e477b5493313f4c920845ee2b69282b1b88c23 (diff)
util/nvmutil: print correct file name for urandom
err_if reports fname, not /dev/urandom Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil/nvmutil.c')
-rw-r--r--util/nvmutil/nvmutil.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index fdf93c67..bb9210b0 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -347,8 +347,9 @@ rhex(void)
if (!n) {
n = sizeof(rnum) - 1;
- err_if(read(rfd, (uint8_t *) &rnum, sizeof(rnum))
- != sizeof(rnum));
+ if (read(rfd, (uint8_t *) &rnum, sizeof(rnum))
+ != sizeof(rnum))
+ err(ECANCELED, "Could not read from /dev/urandom");
}
return rnum[n--] & 0xf;