From: Csaba Kos Date: Fri, 30 May 2014 09:40:15 +0000 (+0900) Subject: script: fix spurious exit from input read loop on EINTR. X-Git-Tag: v2.25-rc1~58 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=578a1691f6d9d66799634c94687c849289f3fc36;p=thirdparty%2Futil-linux.git script: fix spurious exit from input read loop on EINTR. --- diff --git a/term-utils/script.c b/term-utils/script.c index 47bb186bf8..1ae34627f7 100644 --- a/term-utils/script.c +++ b/term-utils/script.c @@ -327,6 +327,7 @@ doinput(void) { while (die == 0) { FD_SET(STDIN_FILENO, &readfds); + errno = 0; /* wait for input or signal (including SIGCHLD) */ if ((cc = pselect(STDIN_FILENO + 1, &readfds, NULL, NULL, NULL, &unblock_mask)) > 0) { @@ -348,7 +349,7 @@ doinput(void) { } resized = 0; - } else if (cc <= 0) { + } else if (cc <= 0 && errno != EINTR) { errsv = errno; break; }