[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r11566 - in /trunk/libc: ChangeLog.eglibc resolv/res_libc.c



Author: joseph
Date: Sun Sep 19 12:42:02 2010
New Revision: 11566

Log:
	* resolv/res_libc (__res_maybe_init): Ask other threads to
	to re-initialize their resolver states when _PATH_RESCONF
	changes.

Modified:
    trunk/libc/ChangeLog.eglibc
    trunk/libc/resolv/res_libc.c

Modified: trunk/libc/ChangeLog.eglibc
==============================================================================
--- trunk/libc/ChangeLog.eglibc (original)
+++ trunk/libc/ChangeLog.eglibc Sun Sep 19 12:42:02 2010
@@ -1,3 +1,9 @@
+2010-09-19  Aurelien Jarno  <aurelien@xxxxxxxxxxx>
+ 
+	* 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@xxxxxxxxx>
 
 	* crypt/crypt.h, posix/unistd.h: Use __libc_block instead of

Modified: trunk/libc/resolv/res_libc.c
==============================================================================
--- trunk/libc/resolv/res_libc.c (original)
+++ trunk/libc/resolv/res_libc.c Sun Sep 19 12:42:02 2010
@@ -100,10 +100,13 @@
 
 	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);