- 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;
+ }