summaryrefslogtreecommitdiff
path: root/src/lib/libc/net/sethostent.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/net/sethostent.c')
-rw-r--r--src/lib/libc/net/sethostent.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/lib/libc/net/sethostent.c b/src/lib/libc/net/sethostent.c
index 00f6499695..40a5a80962 100644
--- a/src/lib/libc/net/sethostent.c
+++ b/src/lib/libc/net/sethostent.c
@@ -1,5 +1,3 @@
1/* $NetBSD: sethostent.c,v 1.4 1995/02/25 06:21:03 cgd Exp $ */
2
3/* 1/*
4 * Copyright (c) 1985, 1993 2 * Copyright (c) 1985, 1993
5 * The Regents of the University of California. All rights reserved. 3 * The Regents of the University of California. All rights reserved.
@@ -34,11 +32,7 @@
34 */ 32 */
35 33
36#if defined(LIBC_SCCS) && !defined(lint) 34#if defined(LIBC_SCCS) && !defined(lint)
37#if 0 35static char rcsid[] = "$OpenBSD: sethostent.c,v 1.5 2003/01/28 04:58:00 marc Exp $";
38static char sccsid[] = "@(#)sethostent.c 8.1 (Berkeley) 6/4/93";
39#else
40static char rcsid[] = "$NetBSD: sethostent.c,v 1.4 1995/02/25 06:21:03 cgd Exp $";
41#endif
42#endif /* LIBC_SCCS and not lint */ 36#endif /* LIBC_SCCS and not lint */
43 37
44#include <sys/param.h> 38#include <sys/param.h>
@@ -47,16 +41,25 @@ static char rcsid[] = "$NetBSD: sethostent.c,v 1.4 1995/02/25 06:21:03 cgd Exp $
47#include <netdb.h> 41#include <netdb.h>
48#include <resolv.h> 42#include <resolv.h>
49 43
44#include "thread_private.h"
45
50void 46void
51sethostent(stayopen) 47sethostent(stayopen)
48 int stayopen;
52{ 49{
50 struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res);
51
52 if ((_resp->options & RES_INIT) == 0 && res_init() == -1)
53 return;
53 if (stayopen) 54 if (stayopen)
54 _res.options |= RES_STAYOPEN | RES_USEVC; 55 _resp->options |= RES_STAYOPEN | RES_USEVC;
55} 56}
56 57
57void 58void
58endhostent() 59endhostent()
59{ 60{
60 _res.options &= ~(RES_STAYOPEN | RES_USEVC); 61 struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res);
61 _res_close(); 62
63 _resp->options &= ~(RES_STAYOPEN | RES_USEVC);
64 res_close();
62} 65}