From f90af15502dbcd4c3fb8df66b77f869d005978cd Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Wed, 1 Apr 2026 06:10:57 +0100 Subject: safer macro Signed-off-by: Leah Rowe --- util/libreboot-utils/lib/file.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'util/libreboot-utils/lib/file.c') diff --git a/util/libreboot-utils/lib/file.c b/util/libreboot-utils/lib/file.c index 805db726..12f52c56 100644 --- a/util/libreboot-utils/lib/file.c +++ b/util/libreboot-utils/lib/file.c @@ -826,12 +826,14 @@ close_on_eintr(int *fd) * ONE MACRO TO RULE THEM ALL: */ #define fs_err_retry() \ - if ((rval == -1) && \ - (errno == EINTR)) \ - return 1; \ - if (rval >= 0 && !errno) \ - errno = saved_errno; \ - return 0 + do { \ + if ((rval == -1) && \ + (errno == EINTR)) \ + return 1; \ + if (rval >= 0 && !errno) \ + errno = saved_errno; \ + return 0; \ + } while(0) /* * Regarding the errno logic above: * on success, it is permitted that -- cgit v1.2.1