chiark / gitweb /
Remove spurious semicolon.
[adns.git] / src / event.c
index 645e5b2a27c8df581bebced00299599a8a85418a..9384085256eb392baf017ee1678001700d8c4b76 100644 (file)
@@ -565,10 +565,15 @@ int adns__internal_check(adns_state ads,
 
   qu= *query_io;
   if (!qu) {
-    if (!ads->output.head) return EWOULDBLOCK;
-    qu= ads->output.head;
+    if (ads->output.head) {
+      qu= ads->output.head;
+    } else if (ads->timew.head) {
+      return EAGAIN;
+    } else {
+      return ESRCH;
+    }
   } else {
-    if (qu->id>=0) return EWOULDBLOCK;
+    if (qu->id>=0) return EAGAIN;
   }
   LIST_UNLINK(ads->output,qu);
   *answer= qu->answer;
@@ -589,7 +594,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);
-    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);