X-Git-Url: https://git.distorted.org.uk/~mdw/adns/blobdiff_plain/bb149f75ad8494e2f955297024c888f04513dea5..9715e5f4f1bcf1790dd7cab02192efd37bcff73a:/client/adnslogres.c 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); }