From 1bd9afad43bdb93e74d849a754ec33bd51428bd1 Mon Sep 17 00:00:00 2001 Message-Id: <1bd9afad43bdb93e74d849a754ec33bd51428bd1.1747440938.git.mdw@distorted.org.uk> From: Mark Wooding Date: Fri, 15 Oct 1999 16:46:14 +0000 Subject: [PATCH] adnslogres aargh change from fanf. Organization: Straylight/Edgeware From: ian --- client/adnslogres.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/client/adnslogres.c b/client/adnslogres.c index 25d66ba..79d3da6 100644 --- a/client/adnslogres.c +++ b/client/adnslogres.c @@ -30,7 +30,7 @@ */ static const char * const cvsid = - "$Id: adnslogres.c,v 1.6 1999/10/15 16:43:23 ian Exp $"; + "$Id: adnslogres.c,v 1.7 1999/10/15 16:46:14 ian Exp $"; #include #include @@ -56,9 +56,12 @@ static const char * const cvsid = static const char *progname; -static void aargh(const char *msg) { - fprintf(stderr, "%s: %s: %s (%d)\n", progname, msg, - strerror(errno) ? strerror(errno) : "Unknown error", errno); +#define msg(fmt, args...) fprintf(stderr, "%s: " fmt "\n", progname, ##args) + +static void aargh(const char *cause) { + const char *why = strerror(errno); + if (!why) why = "Unknown error"; + msg("%s: %s (%d)", cause, why, errno); exit(1); } -- [mdw]