@@ -499,11 +499,11 @@ php_socket_t php_network_bind_socket_to_local_addr(const char *host, unsigned po
499499}
500500/* }}} */
501501
502- PHPAPI int php_network_parse_network_address_with_port (const char * addr , zend_long addrlen , struct sockaddr * sa , socklen_t * sl )
502+ PHPAPI zend_result php_network_parse_network_address_with_port (const char * addr , size_t addrlen , struct sockaddr * sa , socklen_t * sl )
503503{
504504 char * colon ;
505505 char * tmp ;
506- int ret = FAILURE ;
506+ zend_result ret = FAILURE ;
507507 short port ;
508508 struct sockaddr_in * in4 = (struct sockaddr_in * )sa ;
509509 struct sockaddr * * psal ;
@@ -843,7 +843,7 @@ php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short
843843 struct sockaddr_in6 in6 ;
844844#endif
845845 } local_address = {0 };
846- int local_address_len = 0 ;
846+ size_t local_address_len = 0 ;
847847
848848 if (sa -> sa_family == AF_INET ) {
849849 if (inet_pton (AF_INET , bindto , & local_address .in4 .sin_addr ) == 1 ) {
@@ -974,7 +974,7 @@ PHPAPI void php_any_addr(int family, php_sockaddr_storage *addr, unsigned short
974974/* {{{ php_sockaddr_size
975975 * Returns the size of struct sockaddr_xx for the family
976976 */
977- PHPAPI int php_sockaddr_size (php_sockaddr_storage * addr )
977+ PHPAPI socklen_t php_sockaddr_size (php_sockaddr_storage * addr )
978978{
979979 switch (((struct sockaddr * )addr )-> sa_family ) {
980980 case AF_INET :
@@ -1099,9 +1099,9 @@ PHPAPI php_stream *_php_stream_sock_open_host(const char *host, unsigned short p
10991099 return stream ;
11001100}
11011101
1102- PHPAPI int php_set_sock_blocking (php_socket_t socketd , int block )
1102+ PHPAPI zend_result php_set_sock_blocking (php_socket_t socketd , bool block )
11031103{
1104- int ret = SUCCESS ;
1104+ zend_result ret = SUCCESS ;
11051105
11061106#ifdef PHP_WIN32
11071107 u_long flags ;
@@ -1253,7 +1253,7 @@ static struct hostent * gethostname_re (const char *host,struct hostent *hostbuf
12531253 * tmphstbuf = (char * )realloc (* tmphstbuf ,* hstbuflen );
12541254 }
12551255
1256- if (res != SUCCESS ) {
1256+ if (res != 0 ) {
12571257 return NULL ;
12581258 }
12591259
@@ -1295,7 +1295,7 @@ static struct hostent * gethostname_re (const char *host,struct hostent *hostbuf
12951295 }
12961296 memset ((void * )(* tmphstbuf ),0 ,* hstbuflen );
12971297
1298- if (SUCCESS != gethostbyname_r (host ,hostbuf ,(struct hostent_data * )* tmphstbuf )) {
1298+ if (0 != gethostbyname_r (host ,hostbuf ,(struct hostent_data * )* tmphstbuf )) {
12991299 return NULL ;
13001300 }
13011301
0 commit comments