[debug-ltrace] Add latest version.
Add ltrace 0.5.2, propagate patchset from 0.5.1 and from Debian.
1 Original patch from: gentoo/src/patchsets/glibc/2.9/1055_all_glibc-resolv-dynamic.patch
3 -= BEGIN original header =-
6 if /etc/resolv.conf is updated, then make sure applications
7 already running get the updated information.
9 http://bugs.gentoo.org/177416
11 -= END original header =-
13 diff -durN glibc-2_9.orig/resolv/res_libc.c glibc-2_9/resolv/res_libc.c
14 --- glibc-2_9.orig/resolv/res_libc.c 2006-10-11 10:59:28.000000000 +0200
15 +++ glibc-2_9/resolv/res_libc.c 2009-02-02 22:00:57.000000000 +0100
17 #include <arpa/nameser.h>
19 #include <bits/libc-lock.h>
20 +#include <sys/stat.h>
23 /* The following bit is copied from res_data.c (where it is #ifdef'ed
25 __res_maybe_init (res_state resp, int preinit)
27 if (resp->options & RES_INIT) {
28 + static time_t last_mtime, last_check;
30 + struct stat statbuf;
33 + if (now != last_check) {
35 + if (stat (_PATH_RESCONF, &statbuf) == 0 && last_mtime != statbuf.st_mtime) {
36 + last_mtime = statbuf.st_mtime;
37 + atomicinclock (lock);
38 + atomicinc (__res_initstamp);
39 + atomicincunlock (lock);
42 if (__res_initstamp != resp->_u._ext.initstamp) {
43 if (resp->nscount > 0) {
44 __res_iclose (resp, true);