Commits

Bryan O'Sullivan committed 5ea41c7

Tell gcc what do_log is, and fix a few bad calls.

Comments (0)

Files changed (2)

 	filename = "stdin";
 	fp = stdin;
     } else if ((fp = fopen(filename, "r")) == NULL) {
-	do_log(LOG_ERR, "filename: %m");
+	do_log(LOG_ERR, "%s: %m", filename);
 	return;
     }
 
     }
     
     if (ferror(fp)) {
-	do_log(LOG_ERR, "Error reading %s: %s", filename, strerror(errno));
-	exit(1);
+	do_log(LOG_ERR, "%s: %m", filename);
     }
 
     if (fp != stdin) {
 
 /* utilities */
 
-void do_log(int pri, const char *fmt, ...);
+void do_log(int pri, const char *fmt, ...)
+    __attribute__ ((format (printf, 2, 3)));
 pid_t run_netplug_bg(char *ifname, char *action);
 int run_netplug(char *ifname, char *action);
 void *xmalloc(size_t n);