From: ian Date: Mon, 3 Apr 2006 23:47:13 +0000 (+0000) Subject: * adnstest converts some errno values to EFOOBAR: all of the ones X-Git-Tag: before-srv-2006-04-04~1 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=adns.git;a=commitdiff_plain;h=fa1b90e57a41a62f53f2b7a99621ae8b1348de77;hp=5a5eed735b11d03f51203b39772dcc0129021d68 * adnstest converts some errno values to EFOOBAR: all of the ones mentioned in adns.h, at least. This makes the regression test more portable (fixes problem noticed by Bernd Eckenfels). --- diff --git a/changelog b/changelog index cf90698..6467c9e 100644 --- a/changelog +++ b/changelog @@ -6,6 +6,9 @@ adns (1.1.999.0.2); urgency=medium make a libadns.so.1 -> libadns.so.1. link. (Suggestions and patch from Nix of esperi.org.uk.) * Update MINOR to 2 because of adns_init_logfn. + * adnstest converts some errno values to EFOOBAR: all of the ones + mentioned in adns.h, at least. This makes the regression test + more portable (fixes problem noticed by Bernd Eckenfels). Fixes from or suggested by Bernd Eckenfels, the Debian maintainer: * Correct type of various printf arguments: ptrdiff_t != int. diff --git a/client/adnstest.c b/client/adnstest.c index e99f5a1..36d7ffe 100644 --- a/client/adnstest.c +++ b/client/adnstest.c @@ -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); } diff --git a/regress/case-ndotsbad.err b/regress/case-ndotsbad.err index 700201a..31d3eab 100644 --- a/regress/case-ndotsbad.err +++ b/regress/case-ndotsbad.err @@ -1 +1 @@ -adns failure: init: errno=22 +adns failure: init: errno=EINVAL