From 69d23570f0598d4473533c75d89dfc7da27e07b4 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 14 Oct 2009 14:09:29 +0200 Subject: check stat("/etc/resolv.conf") for errors Signed-off-by: Denys Vlasenko --- libc/inet/resolv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libc/inet') 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 */ -- cgit v1.2.3