diff options
Diffstat (limited to 'util/nvmutil/nvmutil.c')
| -rw-r--r-- | util/nvmutil/nvmutil.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index a8d97d09..475e0a7e 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -718,13 +718,8 @@ open_dev_urandom(void) if (urandom_fd != -1) return; - fprintf(stderr, "Can't open %s (will use %s instead)\n", - newrandom, oldrandom); - rname = oldrandom; urandom_fd = open(rname, O_RDONLY | O_BINARY | O_NONBLOCK); - if (urandom_fd == -1) - err(errno, "%s: could not open", rname); } static void @@ -1001,6 +996,9 @@ rhex(void) static size_t n = 0; static uint8_t rnum[12]; + if (urandom_fd) + err(ECANCELED, "Your operating system has no /dev/[u]random"); + if (!n) { n = sizeof(rnum); if (rw_file_exact(urandom_fd, rnum, n, 0, LESEN) == -1) |
