]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
poll: Added a workaround for AIX to get it to notice IO_ERRORs
authorTimo Sirainen <tss@iki.fi>
Fri, 17 Sep 2010 16:30:30 +0000 (17:30 +0100)
committerTimo Sirainen <tss@iki.fi>
Fri, 17 Sep 2010 16:30:30 +0000 (17:30 +0100)
src/lib/ioloop-poll.c

index 024078ba271791f5d05b074401854399567c5c39..c856eca27ee23f9bed090ba4421a05af290e42a2 100644 (file)
@@ -155,6 +155,14 @@ void io_loop_handler_run(struct ioloop *ioloop)
 
         /* get the time left for next timeout task */
        msecs = io_loop_get_wait_time(ioloop, &tv);
+#ifdef _AIX
+       if (msecs > 1000) {
+               /* AIX seems to check IO_POLL_ERRORs only at the beginning of
+                  the poll() call, not during it. keep timeouts short enough
+                  so that we'll notice them pretty quickly. */
+               msecs = 1000;
+       }
+#endif
 
        ret = poll(ctx->fds, ctx->fds_pos, msecs);
        if (ret < 0 && errno != EINTR)