From a7695375549797a2894546d51ab8c8c3b093f8a8 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 31 Mar 2026 12:06:33 +0100 Subject: lbutils/file: don't alllow EAGAIN/EWOULDBLOCK a non-blocking file descriptor could be used while errno is set to these. this would create an infinite loop. it's better that we only allow EINTR. Signed-off-by: Leah Rowe --- util/libreboot-utils/lib/file.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'util') diff --git a/util/libreboot-utils/lib/file.c b/util/libreboot-utils/lib/file.c index f3fff555..5ab00031 100644 --- a/util/libreboot-utils/lib/file.c +++ b/util/libreboot-utils/lib/file.c @@ -1001,9 +1001,7 @@ close_on_eintr(int *fd) */ #define fs_err_retry() \ if ((rval == -1) && \ - (errno == EINTR || \ - errno == EAGAIN || \ - errno == EWOULDBLOCK)) \ + (errno == EINTR)) \ return 1; \ if (rval >= 0 && !errno) \ errno = saved_errno; \ -- cgit v1.2.1