yann@1365: Original patch from: gentoo/src/patchsets/glibc/2.9/1055_all_glibc-resolv-dynamic.patch yann@1365: yann@1365: -= BEGIN original header =- yann@1365: ripped from SuSE yann@1365: yann@1365: if /etc/resolv.conf is updated, then make sure applications yann@1365: already running get the updated information. yann@1365: yann@1365: http://bugs.gentoo.org/177416 yann@1365: yann@1365: -= END original header =- yann@1365: yann@1365: diff -durN glibc-2_9.orig/resolv/res_libc.c glibc-2_9/resolv/res_libc.c yann@1365: --- glibc-2_9.orig/resolv/res_libc.c 2006-10-11 10:59:28.000000000 +0200 yann@1365: +++ glibc-2_9/resolv/res_libc.c 2009-02-02 22:00:57.000000000 +0100 yann@1365: @@ -22,6 +22,7 @@ yann@1365: #include yann@1365: #include yann@1365: #include yann@1365: +#include yann@1365: yann@1365: yann@1365: /* The following bit is copied from res_data.c (where it is #ifdef'ed yann@1365: @@ -95,6 +96,20 @@ yann@1365: __res_maybe_init (res_state resp, int preinit) yann@1365: { yann@1365: if (resp->options & RES_INIT) { yann@1365: + static time_t last_mtime, last_check; yann@1365: + time_t now; yann@1365: + struct stat statbuf; yann@1365: + yann@1365: + time (&now); yann@1365: + if (now != last_check) { yann@1365: + last_check = now; yann@1365: + if (stat (_PATH_RESCONF, &statbuf) == 0 && last_mtime != statbuf.st_mtime) { yann@1365: + last_mtime = statbuf.st_mtime; yann@1365: + atomicinclock (lock); yann@1365: + atomicinc (__res_initstamp); yann@1365: + atomicincunlock (lock); yann@1365: + } yann@1365: + } yann@1365: if (__res_initstamp != resp->_u._ext.initstamp) { yann@1365: if (resp->nscount > 0) { yann@1365: __res_iclose (resp, true);