From 55b0b396dc41822d719c165ebc239cefc5109269 Mon Sep 17 00:00:00 2001 From: Lucas Date: Sun, 14 Jun 2020 15:00:33 +0000 Subject: [PATCH] Small update to err.[ch] --- cli.c | 2 ++ err.c | 7 +++++++ err.h | 2 -- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cli.c b/cli.c index 7c0c50a..87e0215 100644 --- a/cli.c +++ b/cli.c @@ -24,6 +24,8 @@ #include "err.h" #include "otp.h" +extern const char *__progname; + static void usage(void) { diff --git a/err.c b/err.c index 42bc596..172be6a 100644 --- a/err.c +++ b/err.c @@ -12,6 +12,11 @@ * along with this software. If not, see * . */ +/* + * Inspired by OpenBSD's `err.h' header, found at + * http://man.openbsd.org/err.3 + * http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/gen/verr.c + */ #include #include @@ -21,6 +26,8 @@ #include "err.h" +extern const char *__progname; + void err(int eval, const char *fmt, ...) { diff --git a/err.h b/err.h index 427744c..15b3675 100644 --- a/err.h +++ b/err.h @@ -13,8 +13,6 @@ * . */ -extern const char *__progname; - void err(int, const char *, ...); void errx(int, const char *, ...); void warn(const char *, ...);