chiark / gitweb /
* adnstest converts some errno values to EFOOBAR: all of the ones
authorian <ian>
Mon, 3 Apr 2006 23:47:13 +0000 (23:47 +0000)
committerian <ian>
Mon, 3 Apr 2006 23:47:13 +0000 (23:47 +0000)
    mentioned in adns.h, at least.  This makes the regression test
    more portable (fixes problem noticed by Bernd Eckenfels).

changelog
client/adnstest.c
regress/case-ndotsbad.err

index cf9069854c9d3685c176803e1d4f4851dc72d28f..6467c9e2fbca06c7d9acafe0a665c7c4a810779c 100644 (file)
--- a/changelog
+++ b/changelog
@@ -6,6 +6,9 @@ adns (1.1.999.0.2); urgency=medium
     make a libadns.so.1 -> libadns.so.1.<minor> 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.
index e99f5a1ac4967f42982787dca5b041f5f8b02501..36d7ffe781f1100daf01be348dd8be6f9b935578 100644 (file)
@@ -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);
 }
 
index 700201a72b9479ebae207cc8585f6070add02cab..31d3eabfcc6b3341a22a1e09ebc225a771145764 100644 (file)
@@ -1 +1 @@
-adns failure: init: errno=22
+adns failure: init: errno=EINVAL