summaryrefslogtreecommitdiff
path: root/libc/inet/resolv.c
diff options
context:
space:
mode:
authorUbaldo Porcheddu <ubaldo@eja.it>2016-02-20 22:18:38 +0000
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2016-02-24 22:17:10 +0100
commitf78f0bdec821793fd82734ee6e6c23cd6837e5d9 (patch)
treecce27974a544e554946c1a585221a5d1d75f1edf /libc/inet/resolv.c
parent75d8660d99f1b5b5da471569955ffce9a27e8702 (diff)
Replace /etc/resolv.conf with _PATH_RESCONF to allow portability of the code on system where resolv.conf is not in /etc .
Signed-off-by: Ubaldo Porcheddu <ubaldo@eja.it>
Diffstat (limited to 'libc/inet/resolv.c')
-rw-r--r--libc/inet/resolv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index 4028afcbf..4b33896d3 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -974,7 +974,7 @@ void __open_nameservers(void)
if (!__res_sync) {
/* Reread /etc/resolv.conf if it was modified. */
struct stat sb;
- if (stat("/etc/resolv.conf", &sb) != 0)
+ if (stat(_PATH_RESCONF, &sb) != 0)
sb.st_mtime = 0;
if (resolv_conf_mtime != (uint32_t)sb.st_mtime) {
resolv_conf_mtime = sb.st_mtime;
@@ -988,7 +988,7 @@ void __open_nameservers(void)
__resolv_timeout = RES_TIMEOUT;
__resolv_attempts = RES_DFLRETRY;
- fp = fopen("/etc/resolv.conf", "r");
+ fp = fopen(_PATH_RESCONF, "r");
#ifdef FALLBACK_TO_CONFIG_RESOLVCONF
if (!fp) {
/* If we do not have a pre-populated /etc/resolv.conf then