Handle EAGAIN like we do ENOMEM from poll() and select().

On some systems, poll() and select() can return EAGAIN instead
of ENOMEM if there is a kernel resource shortage.  In this case
we just re-enter the event loop and retry.
This commit is contained in:
Todd C. Miller
2020-05-04 11:23:35 -06:00
parent a212ee64e3
commit 0460008c5b
3 changed files with 3 additions and 3 deletions

View File

@@ -661,7 +661,7 @@ rescan:
nready = sudo_ev_scan_impl(base, flags);
switch (nready) {
case -1:
if (errno == ENOMEM)
if (errno == ENOMEM || errno == EAGAIN)
continue;
if (errno == EINTR) {
/* Interrupted by signal, check for sigevents. */