chiark / gitweb /
+ * Give ESRCH, not EAGAIN, if _check called with no queries outstanding.
[adns.git] / src / event.c
index b2da291e0856ee77669393638b8dd1c409ca6573..9384085256eb392baf017ee1678001700d8c4b76 100644 (file)
@@ -565,8 +565,13 @@ int adns__internal_check(adns_state ads,
 
   qu= *query_io;
   if (!qu) {
-    if (!ads->output.head) return EAGAIN;
-    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 EAGAIN;
   }