Skip to content

Commit

Permalink
fix: handle closed STDOUT/STDERR without exception (#5334)
Browse files Browse the repository at this point in the history
  • Loading branch information
Appla authored and matyhtf committed Jun 6, 2024
1 parent da6550f commit 7f21640
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ext-src/php_swoole.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,7 @@ PHP_RSHUTDOWN_FUNCTION(swoole) {
return;
}
stream =
(php_stream *) zend_fetch_resource2_ex((zstream), "stream", php_file_le_stream(), php_file_le_pstream());
(php_stream *) zend_fetch_resource2_ex((zstream), NULL, php_file_le_stream(), php_file_le_pstream());
if (!stream) {
return;
}
Expand Down
9 changes: 9 additions & 0 deletions tests/swoole_global/closed_stdout.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
--TEST--
swoole_global: handle closed STDOUT/STDERR without exception
--SKIPIF--
<?php require __DIR__ . '/../include/skipif.inc'; ?>
--FILE--
<?php
fclose(STDERR);
?>
--EXPECT--

0 comments on commit 7f21640

Please sign in to comment.