Author: jbailey
Date: 2006-06-09 16:13:33 +0000 (Fri, 09 Jun 2006)
New Revision: 1645

Added:
   
glibc-package/branches/glibc-2.4/debian/patches/any/local-dynamic-resolvconf.diff
Log:
Actually add local-dynamic-resolvconf.diff



Added: 
glibc-package/branches/glibc-2.4/debian/patches/any/local-dynamic-resolvconf.diff
===================================================================
--- 
glibc-package/branches/glibc-2.4/debian/patches/any/local-dynamic-resolvconf.diff
   2006-06-08 21:38:06 UTC (rev 1644)
+++ 
glibc-package/branches/glibc-2.4/debian/patches/any/local-dynamic-resolvconf.diff
   2006-06-09 16:13:33 UTC (rev 1645)
@@ -0,0 +1,39 @@
+# All lines beginning with `# DP:' are a description of the patch.
+# DP: Description: allow dynamic long-running processes to
+# DP: re-read a dynamically updated resolv.conf on the fly
+# DP: Dpatch author: Adam Conrad <[EMAIL PROTECTED]>
+# DP: Patch author: Thorsten Kukuk <[EMAIL PROTECTED]>
+# DP: Upstream status: Ubuntu-Specific
+# DP: Date: 2006-01-13 08:14:21 UTC
+
+--- glibc-2.3.6/resolv/res_libc.c      2004-08-13 15:44:46.000000000 +1000
++++ glibc-2.3.6/resolv/res_libc.c      2006-01-13 19:10:28.000000000 +1100
+@@ -22,7 +22,7 @@
+ #include <arpa/nameser.h>
+ #include <resolv.h>
+ #include <bits/libc-lock.h>
+-
++#include <sys/stat.h>
+ 
+ /* 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
+@@ -100,8 +100,17 @@
+ int
+ __res_maybe_init (res_state resp, int preinit)
+ {
+-      if (resp->options & RES_INIT) {
+-              if (__res_initstamp != resp->_u._ext.initstamp) {
++  static time_t last_mtime;
++  struct stat statbuf;
++  int ret;
++
++              
++  if (resp->options & RES_INIT) {
++      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_nclose (resp);
+                               for (int ns = 0; ns < MAXNS; ns++) {


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to