diff options
| -rw-r--r-- | util/nvmutil/nvmutil.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index d04280d2..a0c990b5 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -1121,8 +1121,26 @@ cmd_helper_cat(void) static void gbe_cat_buf(uint8_t *b) { - if (rw_file_exact(STDOUT_FILENO, b, GBE_PART_SIZE, 0, SCHREIB) == -1) - err(errno, "cat"); + ssize_t rval; + + while (1) { + rval = rw_file_exact(STDOUT_FILENO, b, + GBE_PART_SIZE, 0, SCHREIB); + + if (rval == -1) { + if (errno == EAGAIN) { + errno = 0; + continue; + } + + err(errno, "%s: cat", rname); + } + + if ((size_t)rval != GBE_PART_SIZE) + err(errno, "%s: Partial read", rname); + + break; + } } static void |
