]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
repart: Use ftruncate() instead of posix_allocate()
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 21 Nov 2022 09:44:38 +0000 (10:44 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 21 Nov 2022 09:44:38 +0000 (10:44 +0100)
src/partition/repart.c

index cec57ed81ba2056ef401bd171d09bfadc73d0dae..aa8a99fe1ac7b761c306326a874c85f4740ca04c 100644 (file)
@@ -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");