summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-07-26 15:29:30 +0000
committerRoy Marples <roy@marples.name>2009-07-26 15:29:30 +0000
commitf09a7ec14abde20a65a2f89a1e47cf8e5565e53e (patch)
treef452a19986d64961ad751099dfd42b35157954a9
parent7f4f26b96c152eca0f69639927d6321a6b8fb452 (diff)
downloaddhcpcd-f09a7ec14abde20a65a2f89a1e47cf8e5565e53e.tar.xz
Fix -f /path/to/config, #176.
Also, warn if we cannot open the file.
-rw-r--r--if-options.c6
1 files changed, 5 insertions, 1 deletions
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");