diff options
| author | Roy Marples <roy@marples.name> | 2009-07-26 15:29:30 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2009-07-26 15:29:30 +0000 |
| commit | f09a7ec14abde20a65a2f89a1e47cf8e5565e53e (patch) | |
| tree | f452a19986d64961ad751099dfd42b35157954a9 | |
| parent | 7f4f26b96c152eca0f69639927d6321a6b8fb452 (diff) | |
| download | dhcpcd-f09a7ec14abde20a65a2f89a1e47cf8e5565e53e.tar.xz | |
Fix -f /path/to/config, #176.
Also, warn if we cannot open the file.
| -rw-r--r-- | if-options.c | 6 |
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"); |
