@@ -43,7 +43,7 @@ static php_stream_context *decode_context_param(zval *contextresource TSRMLS_DC)
43
43
44
44
#if HAVE_SOCKETPAIR
45
45
/* {{{ proto array stream_socket_pair(int domain, int type, int protocol)
46
- Creates a pair of indistinguishable socket streams */
46
+ Creates a pair of connected, indistinguishable socket streams */
47
47
PHP_FUNCTION (stream_socket_pair )
48
48
{
49
49
long domain , type , protocol ;
@@ -57,8 +57,9 @@ PHP_FUNCTION(stream_socket_pair)
57
57
}
58
58
59
59
if (0 != socketpair (domain , type , protocol , pair )) {
60
+ char errbuf [256 ];
60
61
php_error_docref (NULL TSRMLS_CC , E_WARNING , "failed to create sockets: [%d]: %s" ,
61
- php_socket_errno (), php_socket_strerror (php_socket_errno ()));
62
+ php_socket_errno (), php_socket_strerror (php_socket_errno (), errbuf , sizeof ( errbuf ) ));
62
63
RETURN_FALSE ;
63
64
}
64
65
@@ -67,8 +68,8 @@ PHP_FUNCTION(stream_socket_pair)
67
68
s1 = php_stream_sock_open_from_socket (pair [0 ], 0 );
68
69
s2 = php_stream_sock_open_from_socket (pair [1 ], 0 );
69
70
70
- add_next_index_zval (return_value , php_stream_get_resource_id (s1 ));
71
- add_next_index_zval (return_value , php_stream_get_resource_id (s2 ));
71
+ add_next_index_resource (return_value , php_stream_get_resource_id (s1 ));
72
+ add_next_index_resource (return_value , php_stream_get_resource_id (s2 ));
72
73
}
73
74
/* }}} */
74
75
#endif
0 commit comments