chiark / gitweb /
Return EAGAIN from _check instead of EWOULDBLOCK.
authorian <ian>
Tue, 12 Oct 1999 22:55:15 +0000 (22:55 +0000)
committerian <ian>
Tue, 12 Oct 1999 22:55:15 +0000 (22:55 +0000)
changelog
client/adnslogres.c
src/adns.h
src/event.c
src/poll.c

index 521c366258608acb9f7356ced4495e1056b087e6..cc9e0582d882d753214c3a55464e543550dfa3f7 100644 (file)
--- a/changelog
+++ b/changelog
@@ -11,6 +11,7 @@ adns (0.5) unstable; urgency=medium
   * RRs with mailboxes never rejected due to strange chars if _raw.
   * Lack of a mailbox produces `.' not `<>'.
   * Better usage messages (and no default query domain) for adnstest.
   * RRs with mailboxes never rejected due to strange chars if _raw.
   * Lack of a mailbox produces `.' not `<>'.
   * Better usage messages (and no default query domain) for adnstest.
+  * Return EAGAIN from _check instead of EWOULDBLOCK.
   
   Bugfixes:
   * Do not invoke __autosys indirectly from __procdgram (result: coredump
   
   Bugfixes:
   * Do not invoke __autosys indirectly from __procdgram (result: coredump
index c2ca2effead5eb0b66337760e3c14400ed34e741..b567bf99e6a83d010085c18d7a3e069b1f6ab19c 100644 (file)
@@ -154,7 +154,7 @@ static void proclog(int opts) {
        err= adns_wait(adns, &head->query, &answer, NULL);
     else
       err= adns_check(adns, &head->query, &answer, NULL);
        err= adns_wait(adns, &head->query, &answer, NULL);
     else
       err= adns_check(adns, &head->query, &answer, NULL);
-    if (err != EWOULDBLOCK) {
+    if (err != EAGAIN) {
        printline(head->start, head->addr, head->rest,
                  answer->status == adns_s_ok ? *answer->rrs.str : NULL);
        line= head; head= head->next;
        printline(head->start, head->addr, head->rest,
                  answer->status == adns_s_ok ? *answer->rrs.str : NULL);
        line= head; head= head->next;
index 7993c8fb79328e37cf0d339cbff107c32078de45..fa9b6ca560d9fde9eb86d6355503d5f8e7249c14 100644 (file)
@@ -231,7 +231,9 @@ typedef enum {
 
   /* permanent errors */
   adns_s_nxdomain,
 
   /* permanent errors */
   adns_s_nxdomain,
-  adns_s_nodata
+  adns_s_nodata,
+
+  adns_s_max_permfail= 499
   
 } adns_status;
 
   
 } adns_status;
 
@@ -320,9 +322,9 @@ typedef struct {
  *  values.
  * 
  *  For _wait and _check failures are reported in the answer
  *  values.
  * 
  *  For _wait and _check failures are reported in the answer
- *  structure, and only 0, ESRCH or (for _check) EWOULDBLOCK is
+ *  structure, and only 0, ESRCH or (for _check) EAGAIN is
  *  returned: if no (appropriate) requests are done adns_check returns
  *  returned: if no (appropriate) requests are done adns_check returns
- *  EWOULDBLOCK; if no (appropriate) requests are outstanding both
+ *  EAGAIN; if no (appropriate) requests are outstanding both
  *  adns_query and adns_wait return ESRCH.
  *
  *  Additionally, _wait can return EINTR if you set adns_if_eintr.
  *  adns_query and adns_wait return ESRCH.
  *
  *  Additionally, _wait can return EINTR if you set adns_if_eintr.
@@ -533,7 +535,7 @@ void adns_checkconsistency(adns_state ads, adns_query qu);
  *  adns_submit 2
  *  adns_submit 3
  *  adns_wait 1
  *  adns_submit 2
  *  adns_submit 3
  *  adns_wait 1
- *  adns_check 3 -> EWOULDBLOCK
+ *  adns_check 3 -> EAGAIN
  *  adns_wait 2
  *  adns_wait 3
  *  ....
  *  adns_wait 2
  *  adns_wait 3
  *  ....
index 645e5b2a27c8df581bebced00299599a8a85418a..b2da291e0856ee77669393638b8dd1c409ca6573 100644 (file)
@@ -565,10 +565,10 @@ int adns__internal_check(adns_state ads,
 
   qu= *query_io;
   if (!qu) {
 
   qu= *query_io;
   if (!qu) {
-    if (!ads->output.head) return EWOULDBLOCK;
+    if (!ads->output.head) return EAGAIN;
     qu= ads->output.head;
   } else {
     qu= ads->output.head;
   } else {
-    if (qu->id>=0) return EWOULDBLOCK;
+    if (qu->id>=0) return EAGAIN;
   }
   LIST_UNLINK(ads->output,qu);
   *answer= qu->answer;
   }
   LIST_UNLINK(ads->output,qu);
   *answer= qu->answer;
@@ -589,7 +589,7 @@ int adns_wait(adns_state ads,
   adns__consistency(ads,*query_io,cc_entex);
   for (;;) {
     r= adns__internal_check(ads,query_io,answer_r,context_r);
   adns__consistency(ads,*query_io,cc_entex);
   for (;;) {
     r= adns__internal_check(ads,query_io,answer_r,context_r);
-    if (r != EWOULDBLOCK) break;
+    if (r != EAGAIN) break;
     maxfd= 0; tvp= 0;
     FD_ZERO(&readfds); FD_ZERO(&writefds); FD_ZERO(&exceptfds);
     adns_beforeselect(ads,&maxfd,&readfds,&writefds,&exceptfds,&tvp,&tvbuf,0);
     maxfd= 0; tvp= 0;
     FD_ZERO(&readfds); FD_ZERO(&writefds); FD_ZERO(&exceptfds);
     adns_beforeselect(ads,&maxfd,&readfds,&writefds,&exceptfds,&tvp,&tvbuf,0);
index fba6de56646a80b9edd41476d165f1853d165c2d..45dc437e4a2d2c24cb7b04d11a76c46964cfd34c 100644 (file)
@@ -106,7 +106,7 @@ int adns_wait_poll(adns_state ads,
 
   for (;;) {
     r= adns__internal_check(ads,query_io,answer_r,context_r);
 
   for (;;) {
     r= adns__internal_check(ads,query_io,answer_r,context_r);
-    if (r != EWOULDBLOCK) goto xit;
+    if (r != EAGAIN) goto xit;
     nfds= MAX_POLLFDS; to= -1;
     adns_beforepoll(ads,fds,&nfds,&to,0);
     r= poll(fds,nfds,to);
     nfds= MAX_POLLFDS; to= -1;
     adns_beforepoll(ads,fds,&nfds,&to,0);
     r= poll(fds,nfds,to);