/[pkg-glibc]/glibc-package/branches/glibc-2.19/debian/patches/any/local-dynamic-resolvconf.diff
ViewVC logotype

Contents of /glibc-package/branches/glibc-2.19/debian/patches/any/local-dynamic-resolvconf.diff

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6096 - (show annotations) (download)
Wed May 21 12:00:44 2014 UTC (5 months ago) by aurel32
File size: 1365 byte(s)
  - patches/any/local-dynamic-resolvconf.diff: new patch from the eglibc
    tree to dynamically take into account changes in resolv.conf.
  - patches/powerpc/local-powerpc8xx-dcbz.diff: new patch from the eglibc
    tree to workaround dcbz issues on PowerPC 8XX CPUs.
  - patches/sh4/local-fpscr_values.diff: new patch from eglibc tree to
    export the ___fpscr_values symbol on SH4.
1 --- a/resolv/res_libc.c
2 +++ b/resolv/res_libc.c
3 @@ -22,12 +22,13 @@
4 #include <arpa/nameser.h>
5 #include <resolv.h>
6 #include <bits/libc-lock.h>
7 -
8 +#include <sys/stat.h>
9
10 /* The following bit is copied from res_data.c (where it is #ifdef'ed
11 out) since res_init() should go into libc.so but the rest of that
12 file should not. */
13
14 +__libc_lock_define_initialized (static, lock);
15 extern unsigned long long int __res_initstamp attribute_hidden;
16 /* We have atomic increment operations on 64-bit platforms. */
17 #if __WORDSIZE == 64
18 @@ -35,7 +36,6 @@
19 # define atomicincunlock(lock) (void) 0
20 # define atomicinc(var) catomic_increment (&(var))
21 #else
22 -__libc_lock_define_initialized (static, lock);
23 # define atomicinclock(lock) __libc_lock_lock (lock)
24 # define atomicincunlock(lock) __libc_lock_unlock (lock)
25 # define atomicinc(var) ++var
26 @@ -94,7 +94,18 @@
27 int
28 __res_maybe_init (res_state resp, int preinit)
29 {
30 + static time_t last_mtime;
31 + struct stat statbuf;
32 + int ret;
33 +
34 if (resp->options & RES_INIT) {
35 + ret = stat (_PATH_RESCONF, &statbuf);
36 + __libc_lock_lock (lock);
37 + if ((ret == 0) && (last_mtime != statbuf.st_mtime)) {
38 + last_mtime = statbuf.st_mtime;
39 + atomicinc (__res_initstamp);
40 + }
41 + __libc_lock_unlock (lock);
42 if (__res_initstamp != resp->_u._ext.initstamp) {
43 if (resp->nscount > 0)
44 __res_iclose (resp, true);

  ViewVC Help
Powered by ViewVC 1.1.5