diff options
Diffstat (limited to 'src/lib/libc/net/sethostent.c')
| -rw-r--r-- | src/lib/libc/net/sethostent.c | 13 | 
1 files changed, 9 insertions, 4 deletions
| diff --git a/src/lib/libc/net/sethostent.c b/src/lib/libc/net/sethostent.c index 5392a2f11b..40a5a80962 100644 --- a/src/lib/libc/net/sethostent.c +++ b/src/lib/libc/net/sethostent.c | |||
| @@ -32,7 +32,7 @@ | |||
| 32 | */ | 32 | */ | 
| 33 | 33 | ||
| 34 | #if defined(LIBC_SCCS) && !defined(lint) | 34 | #if defined(LIBC_SCCS) && !defined(lint) | 
| 35 | static char rcsid[] = "$OpenBSD: sethostent.c,v 1.4 1997/03/15 21:53:50 pefo Exp $"; | 35 | static char rcsid[] = "$OpenBSD: sethostent.c,v 1.5 2003/01/28 04:58:00 marc Exp $"; | 
| 36 | #endif /* LIBC_SCCS and not lint */ | 36 | #endif /* LIBC_SCCS and not lint */ | 
| 37 | 37 | ||
| 38 | #include <sys/param.h> | 38 | #include <sys/param.h> | 
| @@ -41,20 +41,25 @@ static char rcsid[] = "$OpenBSD: sethostent.c,v 1.4 1997/03/15 21:53:50 pefo Exp | |||
| 41 | #include <netdb.h> | 41 | #include <netdb.h> | 
| 42 | #include <resolv.h> | 42 | #include <resolv.h> | 
| 43 | 43 | ||
| 44 | #include "thread_private.h" | ||
| 45 | |||
| 44 | void | 46 | void | 
| 45 | sethostent(stayopen) | 47 | sethostent(stayopen) | 
| 46 | int stayopen; | 48 | int stayopen; | 
| 47 | { | 49 | { | 
| 50 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); | ||
| 48 | 51 | ||
| 49 | if ((_res.options & RES_INIT) == 0 && res_init() == -1) | 52 | if ((_resp->options & RES_INIT) == 0 && res_init() == -1) | 
| 50 | return; | 53 | return; | 
| 51 | if (stayopen) | 54 | if (stayopen) | 
| 52 | _res.options |= RES_STAYOPEN | RES_USEVC; | 55 | _resp->options |= RES_STAYOPEN | RES_USEVC; | 
| 53 | } | 56 | } | 
| 54 | 57 | ||
| 55 | void | 58 | void | 
| 56 | endhostent() | 59 | endhostent() | 
| 57 | { | 60 | { | 
| 58 | _res.options &= ~(RES_STAYOPEN | RES_USEVC); | 61 | struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); | 
| 62 | |||
| 63 | _resp->options &= ~(RES_STAYOPEN | RES_USEVC); | ||
| 59 | res_close(); | 64 | res_close(); | 
| 60 | } | 65 | } | 
