Skip to content

Commit 15073d8

Browse files
committed
Fixed bug #80437
Only chmod if the file has been created.
1 parent fdb05b9 commit 15073d8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

run-tests.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2776,7 +2776,8 @@ function run_test(string $php, $file, array $env): string
27762776
}
27772777

27782778
// write .sh
2779-
$sh_script = <<<SH
2779+
if (strpos($log_format, 'S') !== false) {
2780+
$sh_script = <<<SH
27802781
#!/bin/sh
27812782
27822783
case "$1" in
@@ -2794,10 +2795,11 @@ function run_test(string $php, $file, array $env): string
27942795
;;
27952796
esac
27962797
SH;
2797-
if (strpos($log_format, 'S') !== false && file_put_contents($sh_filename, $sh_script) === false) {
2798-
error("Cannot create test shell script - $sh_filename");
2798+
if (file_put_contents($sh_filename, $sh_script) === false) {
2799+
error("Cannot create test shell script - $sh_filename");
2800+
}
2801+
chmod($sh_filename, 0755);
27992802
}
2800-
chmod($sh_filename, 0755);
28012803

28022804
// write .log
28032805
if (strpos($log_format, 'L') !== false && file_put_contents($log_filename, "

0 commit comments

Comments
 (0)