Skip to content

Commit

Permalink
check posix_isatty callable
Browse files Browse the repository at this point in the history
  • Loading branch information
walkor committed Dec 13, 2022
1 parent d49d79d commit 278db61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,7 @@ public static function resetStd()
$STDOUT = \fopen(static::$stdoutFile, "a");
$STDERR = \fopen(static::$stdoutFile, "a");
// Fix standard output cannot redirect of PHP 8.1.8's bug
if (\posix_isatty(2)) {
if (\function_exists('posix_isatty') && \posix_isatty(2)) {
\ob_start(function ($string) {
\file_put_contents(static::$stdoutFile, $string, FILE_APPEND);
}, 1);
Expand Down

0 comments on commit 278db61

Please sign in to comment.