changeset 1373:0fcfd8fe7113 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:29:30 +0000
parents bf8a3471cc6a
children 177f1ca41012
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:38:51 2009 +0000
+++ b/if-options.c	Sun Jul 26 15:29:30 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");