X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=client%2Fadnstest.c;h=36d7ffe781f1100daf01be348dd8be6f9b935578;hb=fa1b90e57a41a62f53f2b7a99621ae8b1348de77;hp=3aa96c914814feae6d90ec526080895868f2ecb2;hpb=5a0be2445e09e1d0fc6ae995b6c0296bc28e657d;p=adns.git 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); }