Browse Source

Patch from Jeffrey Damick:

With glibc if you do a res_init() that forces a reread of the nameservers file,
but in uClibc the res_init will not force a reread if it has already read the
file because then the nameservers value is greater than 0.

So res_init must call close_nameservers() before calling open_nameservers().
Eric Andersen 22 years ago
parent
commit
5ba5fdb354
1 changed files with 2 additions and 0 deletions
  1. 2 0
      libc/inet/resolv.c

+ 2 - 0
libc/inet/resolv.c

@@ -185,6 +185,7 @@ extern int __decode_answer(unsigned char * message, int offset,
 	struct resolv_answer * a);
 extern int __length_question(unsigned char * message, int offset);
 extern int __open_nameservers(void);
+extern void __close_nameservers(void);
 
 
 #ifdef L_encodeh
@@ -968,6 +969,7 @@ int res_init(void)
 {
 	struct __res_state *rp = &(_res);
 
+	__close_nameservers();
 	__open_nameservers();
 	rp->retrans = RES_TIMEOUT;
 	rp->retry = 4;