From 553ffd7a94ca3993ac5a00ca2ff4e65883f37207 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 22 May 2013 14:19:57 +0100 Subject: [PATCH] tests/mountable/test-internal-parse-mountable.c: Don't fully allocate 1GB disk. This test required 1 GB of free space since it used posix_fallocate instead of creating a sparse disk. Use truncate instead. --- tests/mountable/test-internal-parse-mountable.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/mountable/test-internal-parse-mountable.c b/tests/mountable/test-internal-parse-mountable.c index 19feaa035..28fbea431 100644 --- a/tests/mountable/test-internal-parse-mountable.c +++ b/tests/mountable/test-internal-parse-mountable.c @@ -38,9 +38,8 @@ main (int argc, char *argv[]) exit (EXIT_FAILURE); } - int r = posix_fallocate (fd, 0, 1024*1024*1024); - if (r != 0) { - fprintf (stderr, "posix_fallocate " IMG " 1G: %s\n", strerror (r)); + if (ftruncate (fd, 1024 * 1024 * 1024) == -1) { + perror ("truncate " IMG " 1G"); unlink (IMG); exit (EXIT_FAILURE); }