summary refs log tree commit diff
path: root/io/tst-copy_file_range.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2018-08-21 12:56:53 +0200
committerFlorian Weimer <fweimer@redhat.com>2018-08-21 12:56:53 +0200
commitaa42b3dbcb0326badf377fec2c7fb2f34fdabecd (patch)
tree818cd4e9c75b0dba8c982ce5d3b5def2d358ba05 /io/tst-copy_file_range.c
parentc7627f41baaeb7f1a7b73ff66ef48eaafc1990f6 (diff)
downloadglibc-aa42b3dbcb0326badf377fec2c7fb2f34fdabecd.tar.gz
glibc-aa42b3dbcb0326badf377fec2c7fb2f34fdabecd.tar.xz
glibc-aa42b3dbcb0326badf377fec2c7fb2f34fdabecd.zip
Avoid running some tests if the file system does not support holes
Otherwise, these tests fills up the entire disk (or just run very
slowly and eventually time out).
Diffstat (limited to 'io/tst-copy_file_range.c')
-rw-r--r--io/tst-copy_file_range.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/io/tst-copy_file_range.c b/io/tst-copy_file_range.c
index 3d531a1937..e5b46f91db 100644
--- a/io/tst-copy_file_range.c
+++ b/io/tst-copy_file_range.c
@@ -739,7 +739,12 @@ do_test (void)
     *p = rand () >> 24;
 
   infd = create_temp_file ("tst-copy_file_range-in-", &infile);
-  xclose (create_temp_file ("tst-copy_file_range-out-", &outfile));
+  {
+    int outfd = create_temp_file ("tst-copy_file_range-out-", &outfile);
+    if (!support_descriptor_supports_holes (outfd))
+      FAIL_UNSUPPORTED ("File %s does not support holes", outfile);
+    xclose (outfd);
+  }
 
   /* Try to find a different directory from the default input/output
      file.  */