Fix -f /path/to/config, #176.

Also, warn if we cannot open the file.
This commit is contained in:
Roy Marples 2009-07-26 15:27:00 +00:00
parent 15bad73c4e
commit 5e2062a411

View File

@ -320,6 +320,7 @@ parse_option(struct if_options *ifo, int opt, const char *arg)
struct rt *rt;
switch(opt) {
case 'f': /* FALLTHROUGH */
case 'g': /* FALLTHROUGH */
case 'n': /* FALLTHROUGH */
case 'x': /* FALLTHROUGH */
@ -754,8 +755,11 @@ read_config(const char *file,
/* Parse our options file */
f = fopen(file ? file : CONFIG, "r");
if (!f)
if (f == NULL) {
if (file != NULL)
syslog(LOG_ERR, "fopen `%s': %m", file);
return ifo;
}
while ((line = get_line(f))) {
option = strsep(&line, " \t");