change retry loop to decrement after test
[unix-history] / usr / src / lib / libc / net / sethostent.c
index 3bf8498..f7f596c 100644 (file)
@@ -5,22 +5,25 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)sethostent.c       6.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)sethostent.c       6.3 (Berkeley) %G%";
 #endif LIBC_SCCS and not lint
 
 #endif LIBC_SCCS and not lint
 
-/*
- * These are dummy routines to allow old programs that used /etc/hosts
- * to compile and work with the BIND name server
- */
+#include <sys/types.h>
+#include <arpa/nameser.h>
+#include <netinet/in.h>
+#include <resolv.h>
 
 sethostent(stayopen)
 {
 
 sethostent(stayopen)
 {
-#ifdef lint
-stayopen = stayopen;
-#endif
+       if (stayopen)
+               _res.options |= RES_STAYOPEN | RES_USEVC;
 }
 
 }
 
-endhostent()   {}
+endhostent()
+{
+       _res.options &= ~(RES_STAYOPEN | RES_USEVC);
+       _res_close();
+}
 
 sethostfile(name)
 char *name;
 
 sethostfile(name)
 char *name;