X-Git-Url: https://git.distorted.org.uk/~mdw/adns/blobdiff_plain/5a0be2445e09e1d0fc6ae995b6c0296bc28e657d..333c4e3ea4fc5bcf79d4e4b39780ce5c7e8fbb4b:/client/adnstest.c diff --git a/client/adnstest.c b/client/adnstest.c index 3aa96c9..36d7ffe 100644 --- a/client/adnstest.c +++ b/client/adnstest.c @@ -8,7 +8,7 @@ * * It is part of adns, which is * Copyright (C) 1997-2000 Ian Jackson - * Copyright (C) 1999 Tony Finch + * Copyright (C) 1999-2000 Tony Finch * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,8 +36,8 @@ #include "config.h" #include "adns.h" -#ifndef OUTPUTSTREAM -# define OUTPUTSTREAM stdout +#ifdef ADNS_REGRESS_TEST +# include "hredirect.h" #endif struct myctx { @@ -77,7 +77,18 @@ static void failure_status(const char *what, adns_status st) { static void failure_errno(const char *what, int errnoval) NONRETURNING; static void failure_errno(const char *what, int errnoval) { - fprintf(stderr,"adns failure: %s: errno=%d\n",what,errnoval); + switch (errnoval) { +#define CE(e) \ + case e: fprintf(stderr,"adns failure: %s: errno=" #e "\n",what); break + CE(EINVAL); + CE(EINTR); + CE(ESRCH); + CE(EAGAIN); + CE(ENOSYS); + CE(ERANGE); +#undef CE + default: fprintf(stderr,"adns failure: %s: errno=%d\n",what,errnoval); break; + } quitnow(2); }