mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-03-28 23:19:03 +02:00
util/nvmutil: handle error after check_read_or_die
we already exit reliably in that function. the current code is logically correct, but very weak against future changes. this extra check is essentially redundant, but prevantative against future changes. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -301,6 +301,8 @@ read_gbe_part(int p, int invert)
|
||||
|
||||
if (errno)
|
||||
err(errno, "Unhandled error on read of file '%s'", fname);
|
||||
if (rval != (ssize_t) SIZE_4KB)
|
||||
err(ECANCELED, "Unknown error on read of file '%s'", fname);
|
||||
|
||||
swap(p ^ invert); /* handle big-endian host CPU */
|
||||
}
|
||||
@@ -426,6 +428,8 @@ read_urandom(uint8_t *rnum, size_t rsize)
|
||||
|
||||
if (errno)
|
||||
err(errno, "Unhandled error on read of file '/dev/urandom'");
|
||||
if (rval != (ssize_t) rsize)
|
||||
err(ECANCELED, "Unknown error on read of file '/dev/urandom'");
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
Reference in New Issue
Block a user