chiark / gitweb /
no, do not add new types to adnstest - it breaks regress totally!
[adns.git] / client / adnstest.c
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) {
 
 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);
 }
 
   quitnow(2);
 }