diff options
| author | tedu <> | 2005-03-30 02:58:28 +0000 |
|---|---|---|
| committer | tedu <> | 2005-03-30 02:58:28 +0000 |
| commit | 3b040f7dfaf37c407ea6ede1c8c2092e6bf903fd (patch) | |
| tree | a8ff98cee0b13b3b8eeae1624d717e734dc22bb7 /src/lib/libc/net/gethostnamadr.c | |
| parent | cc22824e6cee4353df96b7aeec5d080789306136 (diff) | |
| download | openbsd-3b040f7dfaf37c407ea6ede1c8c2092e6bf903fd.tar.gz openbsd-3b040f7dfaf37c407ea6ede1c8c2092e6bf903fd.tar.bz2 openbsd-3b040f7dfaf37c407ea6ede1c8c2092e6bf903fd.zip | |
make the resolver stat resolv.conf and update if it changes.
useful feedback and ok deraadt@
Diffstat (limited to 'src/lib/libc/net/gethostnamadr.c')
| -rw-r--r-- | src/lib/libc/net/gethostnamadr.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libc/net/gethostnamadr.c b/src/lib/libc/net/gethostnamadr.c index 0a42d0a27e..c643f2382a 100644 --- a/src/lib/libc/net/gethostnamadr.c +++ b/src/lib/libc/net/gethostnamadr.c | |||
| @@ -48,7 +48,7 @@ | |||
| 48 | */ | 48 | */ |
| 49 | 49 | ||
| 50 | #if defined(LIBC_SCCS) && !defined(lint) | 50 | #if defined(LIBC_SCCS) && !defined(lint) |
| 51 | static const char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.60 2004/07/29 03:09:40 itojun Exp $"; | 51 | static const char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.61 2005/03/30 02:58:28 tedu Exp $"; |
| 52 | #endif /* LIBC_SCCS and not lint */ | 52 | #endif /* LIBC_SCCS and not lint */ |
| 53 | 53 | ||
| 54 | #include <sys/param.h> | 54 | #include <sys/param.h> |
| @@ -479,7 +479,7 @@ gethostbyname(const char *name) | |||
| 479 | struct hostent *hp; | 479 | struct hostent *hp; |
| 480 | extern struct hostent *_gethtbyname2(const char *, int); | 480 | extern struct hostent *_gethtbyname2(const char *, int); |
| 481 | 481 | ||
| 482 | if ((_resp->options & RES_INIT) == 0 && res_init() == -1) | 482 | if (_res_init(0) == -1) |
| 483 | hp = _gethtbyname2(name, AF_INET); | 483 | hp = _gethtbyname2(name, AF_INET); |
| 484 | 484 | ||
| 485 | else if (_resp->options & RES_USE_INET6) { | 485 | else if (_resp->options & RES_USE_INET6) { |
| @@ -505,7 +505,7 @@ gethostbyname2(const char *name, int af) | |||
| 505 | extern struct hostent *_gethtbyname2(const char *, int); | 505 | extern struct hostent *_gethtbyname2(const char *, int); |
| 506 | extern struct hostent *_yp_gethtbyname(const char *); | 506 | extern struct hostent *_yp_gethtbyname(const char *); |
| 507 | 507 | ||
| 508 | if ((_resp->options & RES_INIT) == 0 && res_init() == -1) | 508 | if (_res_init(0) == -1) |
| 509 | return (_gethtbyname2(name, af)); | 509 | return (_gethtbyname2(name, af)); |
| 510 | 510 | ||
| 511 | switch (af) { | 511 | switch (af) { |
| @@ -653,7 +653,7 @@ gethostbyaddr(const char *addr, int len, int af) | |||
| 653 | extern struct hostent *_gethtbyaddr(const char *, int, int); | 653 | extern struct hostent *_gethtbyaddr(const char *, int, int); |
| 654 | extern struct hostent *_yp_gethtbyaddr(const char *); | 654 | extern struct hostent *_yp_gethtbyaddr(const char *); |
| 655 | 655 | ||
| 656 | if ((_resp->options & RES_INIT) == 0 && res_init() == -1) { | 656 | if (_res_init(0) == -1) { |
| 657 | res = _gethtbyaddr(addr, len, af); | 657 | res = _gethtbyaddr(addr, len, af); |
| 658 | return (res); | 658 | return (res); |
| 659 | } | 659 | } |
