Mercurial > hg > dhcpcd
changeset 1372:8b33a6ea3a65 draft
Fix -f /path/to/config, #176.
Also, warn if we cannot open the file.
| author | Roy Marples <roy@marples.name> |
|---|---|
| date | Sun, 26 Jul 2009 15:27:00 +0000 |
| parents | 69a096357e74 |
| children | 0c49c2128721 |
| files | if-options.c |
| diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/if-options.c Sat Jul 25 23:37:20 2009 +0000 +++ b/if-options.c Sun Jul 26 15:27:00 2009 +0000 @@ -320,6 +320,7 @@ struct rt *rt; switch(opt) { + case 'f': /* FALLTHROUGH */ case 'g': /* FALLTHROUGH */ case 'n': /* FALLTHROUGH */ case 'x': /* FALLTHROUGH */ @@ -754,8 +755,11 @@ /* 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");
