From 9715e5f4f1bcf1790dd7cab02192efd37bcff73a Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 15 Oct 1999 16:46:14 +0000 Subject: [PATCH] adnslogres aargh change from fanf. --- client/adnslogres.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client/adnslogres.c b/client/adnslogres.c index a91af87..868734b 100644 --- a/client/adnslogres.c +++ b/client/adnslogres.c @@ -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); } -- 2.30.2