util: retry posix_fallocate() if it fails

We block SIGALRM since d4bf8840a4 so any
remaining EINTR is something we should probably retry with.
This commit is contained in:
Peter Hutterer 2023-10-18 12:03:40 +10:00
parent a3c801097d
commit 19c949a46b

View file

@ -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;