Lines 22-28
Link Here
|
22 |
#include <arpa/nameser.h> |
22 |
#include <arpa/nameser.h> |
23 |
#include <resolv.h> |
23 |
#include <resolv.h> |
24 |
#include <bits/libc-lock.h> |
24 |
#include <bits/libc-lock.h> |
25 |
|
25 |
#include <sys/stat.h> |
26 |
|
26 |
|
27 |
/* The following bit is copied from res_data.c (where it is #ifdef'ed |
27 |
/* The following bit is copied from res_data.c (where it is #ifdef'ed |
28 |
out) since res_init() should go into libc.so but the rest of that |
28 |
out) since res_init() should go into libc.so but the rest of that |
Lines 94-103
Link Here
|
94 |
int |
94 |
int |
95 |
__res_maybe_init (res_state resp, int preinit) |
95 |
__res_maybe_init (res_state resp, int preinit) |
96 |
{ |
96 |
{ |
|
|
97 |
static time_t last_mtime; |
98 |
struct stat statbuf; |
99 |
int ret; |
100 |
|
101 |
|
97 |
if (resp->options & RES_INIT) { |
102 |
if (resp->options & RES_INIT) { |
98 |
if (__res_initstamp != resp->_u._ext.initstamp) { |
103 |
ret = stat (_PATH_RESCONF, &statbuf); |
99 |
if (resp->nscount > 0) { |
104 |
if (__res_initstamp != resp->_u._ext.initstamp |
100 |
__res_iclose (resp, true); |
105 |
|| (ret == 0) && (last_mtime != statbuf.st_mtime)) { |
|
|
106 |
last_mtime = statbuf.st_mtime; |
107 |
if (resp->nscount > 0) { |
108 |
__res_iclose (resp, true); |
101 |
return __res_vinit (resp, 1); |
109 |
return __res_vinit (resp, 1); |
102 |
} |
110 |
} |
103 |
} |
111 |
} |