mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
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).
This commit is contained in:
@ -17,6 +17,7 @@
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <array_length.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <errno.h>
|
||||
@ -26,10 +27,12 @@
|
||||
|
||||
#include <support/check.h>
|
||||
#include <support/temp_file.h>
|
||||
#include <support/support.h>
|
||||
#include <support/xunistd.h>
|
||||
|
||||
static char *temp_filename;
|
||||
static int temp_fd;
|
||||
static bool temp_fd_supports_holes;
|
||||
|
||||
static int do_test (void);
|
||||
|
||||
@ -39,6 +42,7 @@ do_prepare (int argc, char **argv)
|
||||
temp_fd = create_temp_file ("tst-preadvwritev.", &temp_filename);
|
||||
if (temp_fd == -1)
|
||||
FAIL_EXIT1 ("cannot create temporary file");
|
||||
temp_fd_supports_holes = support_descriptor_supports_holes (temp_fd);
|
||||
}
|
||||
#define PREPARE do_prepare
|
||||
|
||||
|
Reference in New Issue
Block a user