Date: Sun, 16 Apr 2017 04:36:22 +0000 (UTC) From: Cy Schubert <cy@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316997 - in head/contrib/ipfilter: lib tools Message-ID: <201704160436.v3G4aMtX011469@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: cy Date: Sun Apr 16 04:36:22 2017 New Revision: 316997 URL: https://svnweb.freebsd.org/changeset/base/316997 Log: Use warnx() to issue error message. Reported by: cem MFC after: 1 week X-MFC with: r316993, r316994 Modified: head/contrib/ipfilter/lib/parsefields.c head/contrib/ipfilter/tools/ipf_y.y Modified: head/contrib/ipfilter/lib/parsefields.c ============================================================================== --- head/contrib/ipfilter/lib/parsefields.c Sun Apr 16 03:49:14 2017 (r316996) +++ head/contrib/ipfilter/lib/parsefields.c Sun Apr 16 04:36:22 2017 (r316997) @@ -1,4 +1,5 @@ #include "ipf.h" +#include <err.h> extern int nohdrfields; @@ -33,7 +34,7 @@ wordtab_t *parsefields(table, arg) } else { fields = reallocarray(fields, num + 1, sizeof(*fields)); if (fields == NULL) { - perror("memory allocation error at __LINE__ in __FUNCTIOIN__ in __FILE__"); + warnx("memory allocation error at %d in %s in %s", __LINE__, __FUNCTION__, __FILE__); abort(); } } Modified: head/contrib/ipfilter/tools/ipf_y.y ============================================================================== --- head/contrib/ipfilter/tools/ipf_y.y Sun Apr 16 03:49:14 2017 (r316996) +++ head/contrib/ipfilter/tools/ipf_y.y Sun Apr 16 04:36:22 2017 (r316997) @@ -9,6 +9,7 @@ #include "ipf.h" #include <sys/ioctl.h> #include <syslog.h> +#include <err.h> #ifdef IPFILTER_BPF # include <pcap.h> #endif @@ -2196,7 +2197,7 @@ char *phrase; s = strtok(NULL, " \r\n\t"), i++) { fb = reallocarray(fb, i / 4 + 1, sizeof(*fb)); if (fb == NULL) { - perror("memory allocation error at __LINE__ in __FUNCTION__ in __FILE"); + warnx("memory allocation error at %d in %s in %s", __LINE__, __FUNCTION__, __FILE__); abort(); } l = (u_32_t)strtol(s, NULL, 0);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201704160436.v3G4aMtX011469>