source:
scripts/fetch/eglibc/2.10.1/35-dynamic_resolv.patch@
b80b685
Last change on this file since b80b685 was b17b911f, checked in by , 15 years ago | |
---|---|
|
|
File size: 967 bytes |
-
libc/resolv/res_libc.c
if /etc/resolv.conf is updated, then make sure applications already running get the updated information. http://bugs.gentoo.org/177416
22 22 #include <arpa/nameser.h> 23 23 #include <resolv.h> 24 24 #include <bits/libc-lock.h> 25 #include <sys/stat.h> 25 26 26 27 27 28 /* The following bit is copied from res_data.c (where it is #ifdef'ed … … 101 102 __res_maybe_init (res_state resp, int preinit) 102 103 { 103 104 if (resp->options & RES_INIT) { 105 static time_t last_mtime, last_check; 106 time_t now; 107 struct stat statbuf; 108 109 time (&now); 110 if (now != last_check) { 111 last_check = now; 112 if (stat (_PATH_RESCONF, &statbuf) == 0 && last_mtime != statbuf.st_mtime) { 113 last_mtime = statbuf.st_mtime; 114 atomicinclock (lock); 115 atomicinc (__res_initstamp); 116 atomicincunlock (lock); 117 } 118 } 104 119 if (__res_initstamp != resp->_u._ext.initstamp) { 105 120 if (resp->nscount > 0) { 106 121 __res_nclose (resp);
Note:
See TracBrowser
for help on using the repository browser.