diff options
Diffstat (limited to 'util/nvmutil/nvmutil.c')
| -rw-r--r-- | util/nvmutil/nvmutil.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 9e0a1e10..010349e9 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -1015,6 +1015,7 @@ rhex(void) n = sizeof(rnum); if (rw_file_exact(urandom_fd, rnum, n, 0, LESEN) == -1) err(errno, "Randomisation failed"); + errno = 0; } return (uint16_t)(rnum[--n] & 0xf); @@ -1323,6 +1324,8 @@ rw_gbe_file_part(size_t p, int rw_type, rw_type) == -1) err(errno, "%s: %s: part %lu", fname, rw_type_str, (unsigned long)p); + + errno = 0; } /* @@ -1440,17 +1443,6 @@ rw_file_exact(int fd, uint8_t *mem, size_t len, rc += (size_t)rval; continue; } - if (errno == EINTR) { - /* - * EINTR is not fatal, because we - * eventually return. We rely on - * errno for general error state - * after return from rw_file_exact, - * so we don't want a false error. - */ - errno = 0; - continue; - } set_err(EIO); return -1; |
