From 2d69d45e26a0156cbafdff76c97ddb54cfe3f9e4 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Wed, 1 Apr 2026 20:36:05 +0100 Subject: remove dead code Signed-off-by: Leah Rowe --- util/libreboot-utils/include/common.h | 1 - util/libreboot-utils/lib/file.c | 12 ------------ util/libreboot-utils/lib/rand.c | 14 +++++++------- 3 files changed, 7 insertions(+), 20 deletions(-) diff --git a/util/libreboot-utils/include/common.h b/util/libreboot-utils/include/common.h index f249e6a5..d08828df 100644 --- a/util/libreboot-utils/include/common.h +++ b/util/libreboot-utils/include/common.h @@ -465,7 +465,6 @@ int io_args(int fd, void *mem, size_t nrw, off_t off, int rw_type); int check_file(int fd, struct stat *st); ssize_t rw_over_nrw(ssize_t r, size_t nrw); -int off_retry(int saved_errno, off_t rval); int sys_retry(int saved_errno, long rval); int fs_retry(int saved_errno, int rval); int rw_retry(int saved_errno, ssize_t rval); diff --git a/util/libreboot-utils/lib/file.c b/util/libreboot-utils/lib/file.c index 986bf788..a788d4af 100644 --- a/util/libreboot-utils/lib/file.c +++ b/util/libreboot-utils/lib/file.c @@ -762,18 +762,6 @@ xclose(int *fd) */ -/* retry switch for offset-based - * functions e.g. lseek - */ -/* retry switch for functions that - return long status e.g. linux syscall - */ -int -off_retry(int saved_errno, off_t rval) -{ - fs_err_retry(); -} - /* retry switch for functions that return long status e.g. linux syscall */ diff --git a/util/libreboot-utils/lib/rand.c b/util/libreboot-utils/lib/rand.c index 153798f6..bf090b43 100644 --- a/util/libreboot-utils/lib/rand.c +++ b/util/libreboot-utils/lib/rand.c @@ -156,24 +156,24 @@ retry_rand: { #if defined(USE_URANDOM) && \ ((USE_URANDOM) > 0) - ssize_t rc; + ssize_t rval; int fd = -1; open_file_on_eintr("/dev/urandom", &fd, O_RDONLY, 0400, NULL); while (rw_retry(saved_errno, - rc = rw(fd, (unsigned char *)buf + off, n - off, 0, IO_READ))); + rval = rw(fd, (unsigned char *)buf + off, n - off, 0, IO_READ))); #elif defined(__linux__) - long rc; + long rval; while (sys_retry(saved_errno, - rc = syscall(SYS_getrandom, + rval = syscall(SYS_getrandom, (unsigned char *)buf + off, n - off, 0))); #else #error Unsupported operating system (possibly unsecure randomisation) #endif - if (rc < 0 || /* syscall fehler */ - rc == 0) { /* prevent infinite loop on fatal err */ + if (rval < 0 || /* syscall fehler */ + rval == 0) { /* prevent infinite loop on fatal err */ #if defined(USE_URANDOM) && \ ((USE_URANDOM) > 0) xclose(&fd); @@ -181,7 +181,7 @@ retry_rand: { goto err; } - if ((off += (size_t)rc) < n) + if ((off += (size_t)rval) < n) goto retry_rand; #if defined(USE_URANDOM) && \ -- cgit v1.2.1