Break apart the list of functions defined in universal.c by perl
[p5sagit/p5-mst-13.2.git] / ext / Socket / Socket.xs
index 2650cac..076297f 100644 (file)
@@ -182,7 +182,7 @@ my_inet_aton(register const char *cp, struct in_addr *addr)
 
 
 static int
-not_here(char *s)
+not_here(const char *s)
 {
     croak("Socket::%s not implemented on this architecture", s);
     return -1;
@@ -231,12 +231,10 @@ inet_aton(host)
        {
        struct in_addr ip_address;
        struct hostent * phe;
-       int ok =
-               (host != NULL) &&
-               (*host != '\0') &&
-               inet_aton(host, &ip_address);
+       int ok = (*host != '\0') && inet_aton(host, &ip_address);
 
-       if (!ok && (phe = gethostbyname(host))) {
+       if (!ok && (phe = gethostbyname(host)) &&
+                       phe->h_addrtype == AF_INET && phe->h_length == 4) {
                Copy( phe->h_addr, &ip_address, phe->h_length, char );
                ok = 1;
        }