diff options
| author | Jacques Vidrine <nectar@FreeBSD.org> | 2000-09-10 19:06:05 +0000 |
|---|---|---|
| committer | Jacques Vidrine <nectar@FreeBSD.org> | 2000-09-10 19:06:05 +0000 |
| commit | 6737f02e97c631385c18e965583e508aa7256d63 (patch) | |
| tree | e40900cba38c6bb0c939b8f5a5228cd827b8b0f9 /lib/libc/net | |
| parent | 31a054d673d9a97db8d7b19f9887ee1e236ad2fd (diff) | |
Notes
Diffstat (limited to 'lib/libc/net')
| -rw-r--r-- | lib/libc/net/gethostbynis.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/libc/net/gethostbynis.c b/lib/libc/net/gethostbynis.c index 518d51207332..f339d03d86bc 100644 --- a/lib/libc/net/gethostbynis.c +++ b/lib/libc/net/gethostbynis.c @@ -50,6 +50,8 @@ static char rcsid[] = "$FreeBSD$"; #define MAXALIASES 35 #define MAXADDRS 35 +extern int h_errno; + #ifdef YP static char *host_aliases[MAXALIASES]; static char hostaddr[MAXADDRS]; @@ -76,15 +78,20 @@ _gethostbynis(name, map, af) case AF_INET6: size = NS_IN6ADDRSZ; errno = EAFNOSUPPORT; + h_errno = NETDB_INTERNAL; return NULL; } if (domain == (char *)NULL) - if (yp_get_default_domain (&domain)) + if (yp_get_default_domain (&domain)) { + h_errno = NETDB_INTERNAL; return ((struct hostent *)NULL); + } - if (yp_match(domain, map, name, strlen(name), &result, &resultlen)) + if (yp_match(domain, map, name, strlen(name), &result, &resultlen)) { + h_errno = HOST_NOT_FOUND; return ((struct hostent *)NULL); + } /* avoid potential memory leak */ bcopy((char *)result, (char *)&ypbuf, resultlen); |
