--- glibc-2.4/resolv/res_libc.c.orig 2005-11-01 01:06:40.000000000 +0100 +++ glibc-2.4/resolv/res_libc.c 2006-09-26 00:00:22.000000000 +0200 @@ -22,7 +22,7 @@ #include #include #include - +#include /* The following bit is copied from res_data.c (where it is #ifdef'ed out) since res_init() should go into libc.so but the rest of that @@ -94,10 +94,18 @@ int __res_maybe_init (res_state resp, int preinit) { + static time_t last_mtime; + struct stat statbuf; + int ret; + + if (resp->options & RES_INIT) { - if (__res_initstamp != resp->_u._ext.initstamp) { - if (resp->nscount > 0) { - __res_iclose (resp, true); + ret = stat (_PATH_RESCONF, &statbuf); + if (__res_initstamp != resp->_u._ext.initstamp + || (ret == 0) && (last_mtime != statbuf.st_mtime)) { + last_mtime = statbuf.st_mtime; + if (resp->nscount > 0) { + __res_iclose (resp, true); return __res_vinit (resp, 1); } }