diff --git a/xapian-core/tests/unittest.cc b/xapian-core/tests/unittest.cc
index 36ab22c3e3cb..8d5e2bbc9679 100644
a
|
b
|
try {
|
939 | 939 | SKIP_TEST("Skipping rest of testcase - no Large File Support"); |
940 | 940 | } |
941 | 941 | |
942 | | #ifndef __WIN32__ |
| 942 | #ifdef SEEK_HOLE |
943 | 943 | struct stat statbuf; |
944 | 944 | TEST(fstat(fd, &statbuf) == 0); |
945 | | TEST_REL(statbuf.st_blocks, >=, BLOCK_SIZE / 512 * 2); |
946 | | if (statbuf.st_blocks >= BLOCK_SIZE / 512 * (12 + 1)) { |
| 945 | |
| 946 | off_t hole = lseek(fd, 0, SEEK_HOLE); |
| 947 | if (hole < 0) { |
| 948 | close(fd); |
| 949 | io_unlink(tmp_file); |
| 950 | SKIP_TEST("Skipping rest of testcase - SEEK_HOLE failed"); |
| 951 | } |
| 952 | if (hole >= statbuf.st_size) { |
947 | 953 | close(fd); |
948 | 954 | io_unlink(tmp_file); |
949 | 955 | SKIP_TEST("Skipping rest of testcase - sparse files not supported"); |
… |
… |
try {
|
982 | 988 | #else |
983 | 989 | close(fd); |
984 | 990 | io_unlink(tmp_file); |
985 | | SKIP_TEST("Skipping rest of testcase - FS doesn't support holes"); |
| 991 | SKIP_TEST("Skipping rest of testcase - SEEK_HOLE not supported"); |
986 | 992 | #endif |
987 | 993 | } catch (const Xapian::Error& e) { |
988 | 994 | // Translate Xapian::Error exceptions to std::string exceptions which |