Skip to content

Commit

Permalink
Fixed bug #80437
Browse files Browse the repository at this point in the history
Only chmod if the file has been created.
  • Loading branch information
nikic committed Nov 30, 2020
1 parent fdb05b9 commit 15073d8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions run-tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -2776,7 +2776,8 @@ function run_test(string $php, $file, array $env): string
}

// write .sh
$sh_script = <<<SH
if (strpos($log_format, 'S') !== false) {
$sh_script = <<<SH
#!/bin/sh
case "$1" in
Expand All @@ -2794,10 +2795,11 @@ function run_test(string $php, $file, array $env): string
;;
esac
SH;
if (strpos($log_format, 'S') !== false && file_put_contents($sh_filename, $sh_script) === false) {
error("Cannot create test shell script - $sh_filename");
if (file_put_contents($sh_filename, $sh_script) === false) {
error("Cannot create test shell script - $sh_filename");
}
chmod($sh_filename, 0755);
}
chmod($sh_filename, 0755);

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

0 comments on commit 15073d8

Please sign in to comment.