Skip to content

Commit 4e9d4b2

Browse files
committed
fix: handle closed STDOUT/STDERR without exception
1 parent d3c9dfe commit 4e9d4b2

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
@@ -1078,7 +1078,7 @@ PHP_RSHUTDOWN_FUNCTION(swoole) {
10781078
return;
10791079
}
10801080
stream =
1081-
(php_stream *) zend_fetch_resource2_ex((zstream), "stream", php_file_le_stream(), php_file_le_pstream());
1081+
(php_stream *) zend_fetch_resource2_ex((zstream), NULL, php_file_le_stream(), php_file_le_pstream());
10821082
if (!stream) {
10831083
return;
10841084
}
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)