summaryrefslogtreecommitdiffstats
path: root/patches/glibc-2.23/0200-resolv-dynamic.patch
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2015-11-16 19:23:18 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2016-06-22 07:53:33 +0200
commit8f1e74bc8a0ee2d06d944a1c94d5884abd09b7b2 (patch)
tree3579907a2095fca3e0766e037f982cfd5a967999 /patches/glibc-2.23/0200-resolv-dynamic.patch
parent65c27afba3d7287d85818d6a08b6169ebbbdd37b (diff)
downloadOSELAS.Toolchain-8f1e74bc8a0ee2d06d944a1c94d5884abd09b7b2.tar.gz
OSELAS.Toolchain-8f1e74bc8a0ee2d06d944a1c94d5884abd09b7b2.tar.xz
glibc-2.23 patches
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'patches/glibc-2.23/0200-resolv-dynamic.patch')
-rw-r--r--patches/glibc-2.23/0200-resolv-dynamic.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/patches/glibc-2.23/0200-resolv-dynamic.patch b/patches/glibc-2.23/0200-resolv-dynamic.patch
new file mode 100644
index 0000000..e47dfd7
--- /dev/null
+++ b/patches/glibc-2.23/0200-resolv-dynamic.patch
@@ -0,0 +1,47 @@
+From: unknown author <unknown.author@example.com>
+Date: Tue, 1 Nov 2011 18:58:26 +0100
+Subject: [PATCH] resolv dynamic
+
+ripped from SuSE
+
+if /etc/resolv.conf is updated, then make sure applications
+already running get the updated information.
+
+http://bugs.gentoo.org/177416
+---
+ resolv/res_libc.c | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+diff --git a/resolv/res_libc.c b/resolv/res_libc.c
+index a8394e0e7bc7..d25f54f0fc9f 100644
+--- a/resolv/res_libc.c
++++ b/resolv/res_libc.c
+@@ -22,6 +22,7 @@
+ #include <arpa/nameser.h>
+ #include <resolv.h>
+ #include <libc-lock.h>
++#include <sys/stat.h>
+
+
+ /* The following bit is copied from res_data.c (where it is #ifdef'ed
+@@ -95,6 +96,20 @@ int
+ __res_maybe_init (res_state resp, int preinit)
+ {
+ if (resp->options & RES_INIT) {
++ static time_t last_mtime, last_check;
++ time_t now;
++ struct stat statbuf;
++
++ time (&now);
++ if (now != last_check) {
++ last_check = now;
++ if (stat (_PATH_RESCONF, &statbuf) == 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);