]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix -f /path/to/config, #176.
authorRoy Marples <roy@marples.name>
Sun, 26 Jul 2009 15:29:30 +0000 (15:29 +0000)
committerRoy Marples <roy@marples.name>
Sun, 26 Jul 2009 15:29:30 +0000 (15:29 +0000)
Also, warn if we cannot open the file.

if-options.c

index 7d30ac6c48d84d9f27b081a8130bafb3c13c80b5..7415bebd71d206f651f141255b027f30f66911c1 100644 (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");