From: Todd C. Miller Date: Fri, 13 Apr 2001 01:42:50 +0000 (+0000) Subject: select() may return EAGAIN. If so, continue like we do for EINTR. X-Git-Tag: SUDO_1_6_4~192 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2d9fb0a5ab2d66610292797d08cb6699cd89fdcf;p=sudo select() may return EAGAIN. If so, continue like we do for EINTR. --- diff --git a/tgetpass.c b/tgetpass.c index 56253392c..184688c20 100644 --- a/tgetpass.c +++ b/tgetpass.c @@ -195,10 +195,12 @@ tgetline(fd, buf, bufsiz, timeout) /* Make sure there is something to read (or timeout) */ while ((n = select(fd + 1, readfds, 0, 0, &tv)) == -1 && - errno == EINTR) + (errno == EINTR || errno == EAGAIN)) ; - if (n == 0) + if (n == 0) { + free(readfds); return(NULL); /* timeout */ + } /* Read a character, exit loop on error, EOF or EOL */ n = read(fd, &c, 1);