mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-09-02 07:15:44 +00:00
Make it a warning rather than an error if resolv.conf is missing.
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user