From: Daan De Meyer Date: Mon, 21 Nov 2022 09:44:38 +0000 (+0100) Subject: repart: Use ftruncate() instead of posix_allocate() X-Git-Tag: v253-rc1~485^2~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=983154f51831d0ee96ee08aed3367ea9990009e9;p=thirdparty%2Fsystemd.git repart: Use ftruncate() instead of posix_allocate() --- diff --git a/src/partition/repart.c b/src/partition/repart.c index cec57ed81ba..aa8a99fe1ac 100644 --- a/src/partition/repart.c +++ b/src/partition/repart.c @@ -3199,7 +3199,7 @@ static int partition_encrypt(Context *context, Partition *p, const char *node) { return log_error_errno(r, "Failed to create temporary LUKS header file: %m"); /* Weird cryptsetup requirement which requires the header file to be the size of at least one sector. */ - r = posix_fallocate(fileno(h), 0, context->sector_size); + r = ftruncate(fileno(h), context->sector_size); if (r < 0) return log_error_errno(r, "Failed to grow temporary LUKS header file: %m");