mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-20 15:03:44 +02:00
libreboot-utils/lib: loop eintr on [p]read/[p]write
i forgot to do this! with this, I/O should be bullet proof now. i already loop this on other I/O commands. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -150,7 +150,8 @@ rset(void *buf, size_t n)
|
||||
int fd = -1;
|
||||
open_on_eintr("/dev/urandom", &fd, O_RDONLY, 0400, NULL);
|
||||
retry_rand:
|
||||
if ((rc = read(fd, (unsigned char *)buf + off, n - off)) < 0) {
|
||||
if ((rc = read_on_eintr(fd,
|
||||
(unsigned char *)buf + off, n - off)) < 0) {
|
||||
#elif defined(__linux__)
|
||||
retry_rand:
|
||||
if ((rc = (ssize_t)syscall(SYS_getrandom,
|
||||
|
||||
Reference in New Issue
Block a user