From fa1b90e57a41a62f53f2b7a99621ae8b1348de77 Mon Sep 17 00:00:00 2001 From: ian Date: Mon, 3 Apr 2006 23:47:13 +0000 Subject: [PATCH 1/1] * 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). --- changelog | 3 +++ client/adnstest.c | 13 ++++++++++++- regress/case-ndotsbad.err | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) 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 -- 2.30.2