com php-src: Skip large ftruncate test if large files not supported: ext/standard/tests/file/ftruncate_bug76422.phpt
| From: | Nikita Popov | Date: | Thu, 24 Oct 2019 12:46:49 +0000 |
| Subject: | com php-src: Skip large ftruncate test if large files not supported: ext/standard/tests/file/ftruncate_bug76422.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-109040@lists.php.net to get a copy of this message | ||
Commit: edf7346810292967f41e60fb1474e09e1558862d
Author: Nikita Popov <nikita.ppv@gmail.com> Thu, 24 Oct 2019 14:32:11 +0200
Parents: 6aa6d70e9d24d45d75670a2f78763f95681d0147
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=edf7346810292967f41e60fb1474e09e1558862d
Log:
Skip large ftruncate test if large files not supported
Changed paths:
M ext/standard/tests/file/ftruncate_bug76422.phpt
Diff:
diff --git a/ext/standard/tests/file/ftruncate_bug76422.phpt
b/ext/standard/tests/file/ftruncate_bug76422.phpt
index 4f434d324ab..77334545a97 100644
--- a/ext/standard/tests/file/ftruncate_bug76422.phpt
+++ b/ext/standard/tests/file/ftruncate_bug76422.phpt
@@ -17,6 +17,15 @@ if (false === $file_handle) {
die('Cannot open test file :/');
}
+/* Check if ftruncate() with 2GB works. If it doesn't, it's likely that large files are
+ * generally not supported (EFBIG). */
+$truncate_offset = 2 * 1024 * 1024 * 1024;
+$ftruncate_result = ftruncate($file_handle, $truncate_offset);
+if (false === $ftruncate_result) {
+ var_dump(true);
+ return;
+}
+
$truncate_offset = 4 * 1024 * 1024 * 1024 + 1;
$ftruncate_result = ftruncate($file_handle, $truncate_offset);