Skip to content

Commit 8b80b4f

Browse files
authored
fix: handle closed STDOUT/STDERR without exception (#5334)
1 parent 4248fe7 commit 8b80b4f

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

ext-src/php_swoole.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,7 @@ PHP_RSHUTDOWN_FUNCTION(swoole) {
10871087
return;
10881088
}
10891089
stream =
1090-
(php_stream *) zend_fetch_resource2_ex((zstream), "stream", php_file_le_stream(), php_file_le_pstream());
1090+
(php_stream *) zend_fetch_resource2_ex((zstream), NULL, php_file_le_stream(), php_file_le_pstream());
10911091
if (!stream) {
10921092
return;
10931093
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
--TEST--
2+
swoole_global: handle closed STDOUT/STDERR without exception
3+
--SKIPIF--
4+
<?php require __DIR__ . '/../include/skipif.inc'; ?>
5+
--FILE--
6+
<?php
7+
fclose(STDERR);
8+
?>
9+
--EXPECT--

0 commit comments

Comments
 (0)