diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-14 14:09:29 +0200 |
---|---|---|
committer | Austin Foxley <austinf@cetoncorp.com> | 2009-10-16 11:44:11 -0700 |
commit | b6e6a6430d084c9dace10a73aa5559e777809946 (patch) | |
tree | 8cd4a7a4dab76c7a4d5d846145aed8d978905908 /libc/inet/resolv.c | |
parent | d14a2961de93e949818dbb9f67acaa88dc1a2320 (diff) | |
download | uClibc-alpine-b6e6a6430d084c9dace10a73aa5559e777809946.tar.bz2 uClibc-alpine-b6e6a6430d084c9dace10a73aa5559e777809946.tar.xz |
check stat("/etc/resolv.conf") for errors
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Diffstat (limited to 'libc/inet/resolv.c')
-rw-r--r-- | libc/inet/resolv.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c index ee06b44be..abb84df79 100644 --- a/libc/inet/resolv.c +++ b/libc/inet/resolv.c @@ -959,7 +959,8 @@ void attribute_hidden __open_nameservers(void) if (!__res_sync) { /* Reread /etc/resolv.conf if it was modified. */ struct stat sb; - stat("/etc/resolv.conf", &sb); + if (stat("/etc/resolv.conf", &sb) != 0) + sb.st_mtime = 0; if (resolv_conf_mtime != (uint32_t)sb.st_mtime) { resolv_conf_mtime = sb.st_mtime; __close_nameservers(); /* force config reread */ |