mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-18 14:12:44 +02:00
util/nvmutil: tidy up gbe_cat_buf()
Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
+16
-20
@@ -1134,29 +1134,25 @@ gbe_cat_buf(uint8_t *b)
|
|||||||
rval = rw_file_exact(STDOUT_FILENO, b,
|
rval = rw_file_exact(STDOUT_FILENO, b,
|
||||||
GBE_PART_SIZE, 0, SCHREIB);
|
GBE_PART_SIZE, 0, SCHREIB);
|
||||||
|
|
||||||
if (rval == -1) {
|
if (rval >= 0) {
|
||||||
if (errno == EAGAIN) {
|
/*
|
||||||
/*
|
* A partial write is especially
|
||||||
* We assume that no
|
* fatal, as it should already be
|
||||||
* data was written
|
* prevented in rw_file_exact().
|
||||||
* to stdout.
|
*/
|
||||||
*/
|
if ((size_t)rval != GBE_PART_SIZE)
|
||||||
errno = 0;
|
err(EIO, "stdout: cat: Partial write");
|
||||||
continue;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
err(errno, "stdout: cat");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
if (errno != EAGAIN)
|
||||||
* A partial write is especially
|
err(errno, "stdout: cat");
|
||||||
* fatal, as it should already be
|
|
||||||
* prevented in rw_file_exact().
|
|
||||||
*/
|
|
||||||
if ((size_t)rval != GBE_PART_SIZE)
|
|
||||||
err(EIO, "stdout: cat: Partial write");
|
|
||||||
|
|
||||||
break;
|
/*
|
||||||
|
* We assume that no data
|
||||||
|
* was written to stdout.
|
||||||
|
*/
|
||||||
|
errno = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user