3 if /etc/resolv.conf is updated, then make sure applications
4 already running get the updated information.
6 http://bugs.gentoo.org/177416
8 --- libc/resolv/res_libc.c
9 +++ libc/resolv/res_libc.c
11 #include <arpa/nameser.h>
13 #include <libc-lock.h>
14 +#include <sys/stat.h>
17 /* The following bit is copied from res_data.c (where it is #ifdef'ed
19 __res_maybe_init (res_state resp, int preinit)
21 if (resp->options & RES_INIT) {
22 + static time_t last_mtime, last_check;
24 + struct stat statbuf;
27 + if (now != last_check) {
29 + if (stat (_PATH_RESCONF, &statbuf) == 0 && last_mtime != statbuf.st_mtime) {
30 + last_mtime = statbuf.st_mtime;
31 + atomicinclock (lock);
32 + atomicinc (__res_initstamp);
33 + atomicincunlock (lock);
36 if (__res_initstamp != resp->_u._ext.initstamp) {
37 if (resp->nscount > 0) {