If fopen("/etc/ifstated.conf", ...) fails for whatever reason the
error message isn't very helpful:

  $ ifstated -n
  ifstated: /etc/ifstated.conf

With this patch:

  $ ./ifstated -n
  ifstated: /etc/ifstated.conf: No such file or directory



Index: parse.y
===================================================================
RCS file: /cvs/src/usr.sbin/ifstated/parse.y,v
retrieving revision 1.36
diff -u -p -r1.36 parse.y
--- parse.y     20 Nov 2014 05:51:20 -0000      1.36
+++ parse.y     29 Jan 2016 01:56:31 -0000
@@ -685,7 +685,7 @@ pushfile(const char *name, int secret)
                return (NULL);
        }
        if ((nfile->stream = fopen(nfile->name, "r")) == NULL) {
-               warnx("%s", nfile->name);
+               warn("%s", nfile->name);
                free(nfile->name);
                free(nfile);
                return (NULL);

Reply via email to