diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2010-09-19 19:42:02 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2010-09-19 19:42:02 +0000 |
commit | 6961bb5dfaf110cc3ceadc4098fcd8edc515e480 (patch) | |
tree | 5e58f271c268ae2e7684baa5c37f5dbd13aa81d6 /libc | |
parent | 274e6d871acc08da2eb7a30bb6c4604885475465 (diff) |
* resolv/res_libc (__res_maybe_init): Ask other threads to
to re-initialize their resolver states when _PATH_RESCONF
changes.
git-svn-id: svn://svn.eglibc.org/trunk@11566 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc')
-rw-r--r-- | libc/ChangeLog.eglibc | 6 | ||||
-rw-r--r-- | libc/resolv/res_libc.c | 11 |
2 files changed, 13 insertions, 4 deletions
diff --git a/libc/ChangeLog.eglibc b/libc/ChangeLog.eglibc index e5cdb6320..05211822e 100644 --- a/libc/ChangeLog.eglibc +++ b/libc/ChangeLog.eglibc @@ -1,3 +1,9 @@ +2010-09-19 Aurelien Jarno <aurelien@aurel32.net> + + * resolv/res_libc (__res_maybe_init): Ask other threads to + to re-initialize their resolver states when _PATH_RESCONF + changes. + 2010-06-24 Mark Heily <mark@heily.com> * crypt/crypt.h, posix/unistd.h: Use __libc_block instead of diff --git a/libc/resolv/res_libc.c b/libc/resolv/res_libc.c index d28ba026a..5c5b691b6 100644 --- a/libc/resolv/res_libc.c +++ b/libc/resolv/res_libc.c @@ -100,10 +100,13 @@ __res_maybe_init (res_state resp, int preinit) if (resp->options & RES_INIT) { ret = stat (_PATH_RESCONF, &statbuf); - if ((__res_initstamp != resp->_u._ext.initstamp) - || ((ret == 0) && (last_mtime != statbuf.st_mtime))) { - if (ret == 0) - last_mtime = statbuf.st_mtime; + if ((ret == 0) && (last_mtime != statbuf.st_mtime)) { + last_mtime = statbuf.st_mtime; + atomicinclock (lock); + atomicinc (__res_initstamp); + atomicincunlock (lock); + } + if (__res_initstamp != resp->_u._ext.initstamp) { if (resp->nscount > 0) __res_iclose (resp, true); return __res_vinit (resp, 1); |