Index: poll/unix/port.c =================================================================== --- poll/unix/port.c (revision 827861) +++ poll/unix/port.c (working copy) @@ -100,6 +100,9 @@ tvptr = &tv; } + if (max > 0) { + list[0].portev_user = (void *)-1; + } ret = port_getn(port, list, max, nget, tvptr); if (ret < 0) { @@ -108,17 +111,27 @@ switch(rv) { case EINTR: case ETIME: + case EAGAIN: if (*nget > 0) { /* This confusing API can return an event at the same time - * that it reports EINTR or ETIME. If that occurs, just - * report the event. + * that it reports EINTR or ETIME or EAGAIN. If that occurs, + * just report the event. * (Maybe it will be simplified; see thread * http://mail.opensolaris.org * /pipermail/networking-discuss/2009-August/011979.html * This code will still work afterwards.) + * + * At least with ETIME, there may be no event yet nget + * would indicate so, so double check that portev_user was + * filled in. */ - rv = APR_SUCCESS; - break; + if (max > 0 && list[0].portev_user == (void *)-1) { + *nget = 0; + } + else { + rv = APR_SUCCESS; + break; + } } if (rv == ETIME) { rv = APR_TIMEUP;