(getipnodebyname): try gethostbyname2 if we have it

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6610 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1999-07-28 02:52:22 +00:00
parent 38cb45b834
commit 308868e45c

View File

@@ -57,11 +57,15 @@ getipnodebyname (const char *name, int af, int flags, int *error_num)
{ {
struct hostent *tmp; struct hostent *tmp;
#ifdef HAVE_GETHOSTBYNAME2
tmp = gethostbyname2 (name, af);
#else
if (af != AF_INET) { if (af != AF_INET) {
*error_num = NO_ADDRESS; *error_num = NO_ADDRESS;
return NULL; return NULL;
} }
tmp = gethostbyname (name); tmp = gethostbyname (name);
#endif
if (tmp == NULL) { if (tmp == NULL) {
switch (h_errno) { switch (h_errno) {
case HOST_NOT_FOUND : case HOST_NOT_FOUND :