@@ -219,8 +219,7 @@ ZEND_GET_MODULE(sockets)
219219#endif
220220
221221#ifndef HAVE_INET_NTOP
222- /* inet_ntop should be used instead of inet_ntoa */
223- int inet_ntoa_lock = 0 ;
222+ #error inet_ntop unsupported on this platform
224223#endif
225224
226225static bool php_open_listen_sock (php_socket * sock , int port , int backlog ) /* {{{ */
@@ -964,14 +963,7 @@ PHP_FUNCTION(socket_getsockname)
964963#endif
965964 case AF_INET :
966965 sin = (struct sockaddr_in * ) sa ;
967- #ifdef HAVE_INET_NTOP
968966 addr_string = inet_ntop (AF_INET , & sin -> sin_addr , addrbuf , sizeof (addrbuf ));
969- #else
970- while (inet_ntoa_lock == 1 );
971- inet_ntoa_lock = 1 ;
972- addr_string = inet_ntoa (sin -> sin_addr );
973- inet_ntoa_lock = 0 ;
974- #endif
975967 ZEND_TRY_ASSIGN_REF_STRING (addr , addr_string );
976968
977969 if (port != NULL ) {
@@ -1043,14 +1035,7 @@ PHP_FUNCTION(socket_getpeername)
10431035#endif
10441036 case AF_INET :
10451037 sin = (struct sockaddr_in * ) sa ;
1046- #ifdef HAVE_INET_NTOP
10471038 addr_string = inet_ntop (AF_INET , & sin -> sin_addr , addrbuf , sizeof (addrbuf ));
1048- #else
1049- while (inet_ntoa_lock == 1 );
1050- inet_ntoa_lock = 1 ;
1051- addr_string = inet_ntoa (sin -> sin_addr );
1052- inet_ntoa_lock = 0 ;
1053- #endif
10541039 ZEND_TRY_ASSIGN_REF_STRING (arg2 , addr_string );
10551040
10561041 if (arg3 != NULL ) {
@@ -1383,9 +1368,7 @@ PHP_FUNCTION(socket_recvfrom)
13831368#if HAVE_IPV6
13841369 struct sockaddr_in6 sin6 ;
13851370#endif
1386- #ifdef HAVE_INET_NTOP
13871371 char addrbuf [INET6_ADDRSTRLEN ];
1388- #endif
13891372 socklen_t slen ;
13901373 int retval ;
13911374 zend_long arg3 , arg4 ;
@@ -1447,11 +1430,7 @@ PHP_FUNCTION(socket_recvfrom)
14471430 ZSTR_LEN (recv_buf ) = retval ;
14481431 ZSTR_VAL (recv_buf )[ZSTR_LEN (recv_buf )] = '\0' ;
14491432
1450- #ifdef HAVE_INET_NTOP
14511433 address = inet_ntop (AF_INET , & sin .sin_addr , addrbuf , sizeof (addrbuf ));
1452- #else
1453- address = inet_ntoa (sin .sin_addr );
1454- #endif
14551434
14561435 ZEND_TRY_ASSIGN_REF_NEW_STR (arg2 , recv_buf );
14571436 ZEND_TRY_ASSIGN_REF_STRING (arg5 , address ? address : "0.0.0.0" );
0 commit comments