From f09a7ec14abde20a65a2f89a1e47cf8e5565e53e Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Sun, 26 Jul 2009 15:29:30 +0000 Subject: [PATCH] Fix -f /path/to/config, #176. Also, warn if we cannot open the file. --- if-options.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/if-options.c b/if-options.c index 7d30ac6c..7415bebd 100644 --- a/if-options.c +++ b/if-options.c @@ -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"); -- 2.47.2