From 19c949a46b936d72e036bdf793b8dca484f64d25 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 18 Oct 2023 12:03:40 +1000 Subject: [PATCH] util: retry posix_fallocate() if it fails We block SIGALRM since d4bf8840a48854a822951707764b452bacf3dd56 so any remaining EINTR is something we should probably retry with. --- src/util-memfile.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util-memfile.c b/src/util-memfile.c index 6172c04..223199a 100644 --- a/src/util-memfile.c +++ b/src/util-memfile.c @@ -68,8 +68,9 @@ memfile_new(const char *data, size_t sz) { fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK); int rc; - with_signals_blocked(SIGALRM) - rc = posix_fallocate(fd, 0, sz); + with_signals_blocked(SIGALRM) { + rc = SYSCALL(posix_fallocate(fd, 0, sz)); + } if (rc < 0) return NULL;