Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix php_pgsql_fd_cast() wrt. php_stream_can_cast()
This commit is contained in:
Christoph M. Becker 2021-04-20 18:32:05 +02:00
commit 950bb84c7e
No known key found for this signature in database
GPG key ID: D66C9593118BCCB6

View file

@ -4138,16 +4138,17 @@ static int php_pgsql_fd_cast(php_stream *stream, int cast_as, void **ret) /* {{{
switch (cast_as) { switch (cast_as) {
case PHP_STREAM_AS_FD_FOR_SELECT: case PHP_STREAM_AS_FD_FOR_SELECT:
case PHP_STREAM_AS_FD: case PHP_STREAM_AS_FD:
case PHP_STREAM_AS_SOCKETD: case PHP_STREAM_AS_SOCKETD: {
if (ret) {
int fd_number = PQsocket(pgsql); int fd_number = PQsocket(pgsql);
if (fd_number == -1) { if (fd_number == -1) {
return FAILURE; return FAILURE;
} }
if (ret) {
*(php_socket_t *)ret = fd_number; *(php_socket_t *)ret = fd_number;
return SUCCESS; }
} }
return SUCCESS;
ZEND_FALLTHROUGH; ZEND_FALLTHROUGH;
default: default:
return FAILURE; return FAILURE;