Skip to content

Commit 3374adc

Browse files
committed
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4: Fix test in case fallocate(1) is available, but fails
2 parents ced8e88 + 99e7c5c commit 3374adc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ext/standard/tests/file/bug81145.phpt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
66
if (PHP_INT_SIZE !== 8) die("skip this test is for 64bit platforms only");
77
if (disk_free_space(__DIR__) < 0x220000000) die("skip insuffient disk space");
88
if (PHP_OS_FAMILY !== "Windows") {
9-
exec("fallocate -h", $output, $status);
10-
if ($status !== 0) die("skip fallocate(1) not available");
9+
$src = __DIR__ . "/bug81145_src.bin";
10+
define('SIZE_4G', 0x100000000);
11+
exec("fallocate -l " . (SIZE_4G-0x100) . " " . escapeshellarg($src), $output, $status);
12+
if ($status !== 0) die("skip fallocate() not supported");
13+
@unlink(__DIR__ . "/bug81145_src.bin");
1114
}
1215
?>
1316
--FILE--

0 commit comments

Comments
 (0)