Skip to content

Commit 950bb84

Browse files
committed
Merge branch 'PHP-8.0'
* PHP-8.0: Fix php_pgsql_fd_cast() wrt. php_stream_can_cast()
2 parents 8667dc9 + 3c64805 commit 950bb84

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ext/pgsql/pgsql.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4138,16 +4138,17 @@ static int php_pgsql_fd_cast(php_stream *stream, int cast_as, void **ret) /* {{{
41384138
switch (cast_as) {
41394139
case PHP_STREAM_AS_FD_FOR_SELECT:
41404140
case PHP_STREAM_AS_FD:
4141-
case PHP_STREAM_AS_SOCKETD:
4142-
if (ret) {
4141+
case PHP_STREAM_AS_SOCKETD: {
41434142
int fd_number = PQsocket(pgsql);
41444143
if (fd_number == -1) {
41454144
return FAILURE;
41464145
}
41474146

4147+
if (ret) {
41484148
*(php_socket_t *)ret = fd_number;
4149-
return SUCCESS;
4149+
}
41504150
}
4151+
return SUCCESS;
41514152
ZEND_FALLTHROUGH;
41524153
default:
41534154
return FAILURE;

0 commit comments

Comments
 (0)