elf.h: add ELFCOMPRESS_ZSTD
[musl] / src / network / gethostbyname2.c
index c9f90da..bd0da7f 100644 (file)
@@ -2,8 +2,6 @@
 
 #include <sys/socket.h>
 #include <netdb.h>
-#include <string.h>
-#include <netinet/in.h>
 #include <errno.h>
 #include <stdlib.h>
 
@@ -23,5 +21,5 @@ struct hostent *gethostbyname2(const char *name, int af)
                err = gethostbyname2_r(name, af, h,
                        (void *)(h+1), size-sizeof *h, &res, &h_errno);
        } while (err == ERANGE);
-       return err ? 0 : h;
+       return res;
 }