diff options
author | Ted Lemon <source@isc.org> | 1997-06-08 04:05:21 +0000 |
---|---|---|
committer | Ted Lemon <source@isc.org> | 1997-06-08 04:05:21 +0000 |
commit | 732a90b2903efb539c2bbf11a545cfe7314e689c (patch) | |
tree | a355f056d962e378a0c8ab84b0fc904eb5d1e3cd /common/resolv.c | |
parent | 9868534313ee8fac600a1c29270f70818cfc2f74 (diff) | |
download | isc-dhcp-732a90b2903efb539c2bbf11a545cfe7314e689c.tar.gz |
Make it a warning rather than an error if resolv.conf is missing.
Diffstat (limited to 'common/resolv.c')
-rw-r--r-- | common/resolv.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/common/resolv.c b/common/resolv.c index c0a0147f..7aa99d1d 100644 --- a/common/resolv.c +++ b/common/resolv.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: resolv.c,v 1.3 1997/06/03 00:47:40 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: resolv.c,v 1.4 1997/06/08 04:05:20 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -66,8 +66,11 @@ void read_resolv_conf (parse_time) new_parse (path_resolv_conf); eol_token = 1; - if ((cfile = fopen (path_resolv_conf, "r")) == NULL) - error ("Can't open %s: %m", path_resolv_conf); + if ((cfile = fopen (path_resolv_conf, "r")) == NULL) { + warn ("Can't open %s: %m", path_resolv_conf); + return; + } + do { token = next_token (&val, cfile); if (token == EOF) @@ -184,8 +187,10 @@ struct sockaddr_in *pick_name_server () /* Check /etc/resolv.conf and reload it if it's changed. */ if (cur_time > rcdate) { - if (stat (path_resolv_conf, &st) < 0) - error ("Can't stat %s", path_resolv_conf); + if (stat (path_resolv_conf, &st) < 0) { + warn ("Can't stat %s", path_resolv_conf); + return (struct sockaddr_in *)0; + } if (st.st_mtime > rcdate) { char rcbuf [512]; char *s, *t, *u; |