mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-21 09:24:16 +02:00
util/nvmutil: reset errno on urandom partial read
Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -962,8 +962,10 @@ read_gbe_file_exact(int fd, void *buf, size_t len,
|
|||||||
* the smaller amount of bytes and call
|
* the smaller amount of bytes and call
|
||||||
* read_gbe_file_exact again if necessary.
|
* read_gbe_file_exact again if necessary.
|
||||||
*/
|
*/
|
||||||
if (rval > 0)
|
if (rval > 0) {
|
||||||
|
errno = 0;
|
||||||
return rval;
|
return rval;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err(ECANCELED,
|
err(ECANCELED,
|
||||||
@@ -979,6 +981,7 @@ read_gbe_file_exact(int fd, void *buf, size_t len,
|
|||||||
|
|
||||||
err(EINTR, "%s: max retries exceeded on file: %s",
|
err(EINTR, "%s: max retries exceeded on file: %s",
|
||||||
op ? op : "read", path);
|
op ? op : "read", path);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user