summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/glibc/glibc/eglibc-resolv-dynamic.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/glibc/glibc/eglibc-resolv-dynamic.patch')
-rw-r--r--meta/recipes-core/glibc/glibc/eglibc-resolv-dynamic.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/meta/recipes-core/glibc/glibc/eglibc-resolv-dynamic.patch b/meta/recipes-core/glibc/glibc/eglibc-resolv-dynamic.patch
new file mode 100644
index 0000000000..a73bcebe34
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/eglibc-resolv-dynamic.patch
@@ -0,0 +1,54 @@
1cherry-picked from http://www.eglibc.org/archives/patches/msg00772.html
2
3It hasnt yet been merged into glibc
4
5Signed-off-by: Khem Raj
6
7Upstream-Status: Pending
8
9Index: git/resolv/res_libc.c
10===================================================================
11--- git.orig/resolv/res_libc.c 2014-08-27 18:35:15.492070587 +0000
12+++ git/resolv/res_libc.c 2014-08-27 18:35:19.204070587 +0000
13@@ -22,12 +22,13 @@
14 #include <arpa/nameser.h>
15 #include <resolv.h>
16 #include <bits/libc-lock.h>
17-
18+#include <sys/stat.h>
19
20 /* The following bit is copied from res_data.c (where it is #ifdef'ed
21 out) since res_init() should go into libc.so but the rest of that
22 file should not. */
23
24+__libc_lock_define_initialized (static, lock);
25 extern unsigned long long int __res_initstamp attribute_hidden;
26 /* We have atomic increment operations on 64-bit platforms. */
27 #if __WORDSIZE == 64
28@@ -35,7 +36,6 @@
29 # define atomicincunlock(lock) (void) 0
30 # define atomicinc(var) catomic_increment (&(var))
31 #else
32-__libc_lock_define_initialized (static, lock);
33 # define atomicinclock(lock) __libc_lock_lock (lock)
34 # define atomicincunlock(lock) __libc_lock_unlock (lock)
35 # define atomicinc(var) ++var
36@@ -94,7 +94,18 @@
37 int
38 __res_maybe_init (res_state resp, int preinit)
39 {
40+ static time_t last_mtime;
41+ struct stat statbuf;
42+ int ret;
43+
44 if (resp->options & RES_INIT) {
45+ ret = stat (_PATH_RESCONF, &statbuf);
46+ __libc_lock_lock (lock);
47+ if ((ret == 0) && (last_mtime != statbuf.st_mtime)) {
48+ last_mtime = statbuf.st_mtime;
49+ atomicinc (__res_initstamp);
50+ }
51+ __libc_lock_unlock (lock);
52 if (__res_initstamp != resp->_u._ext.initstamp) {
53 if (resp->nscount > 0)
54 __res_iclose (resp, true);