]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
script: fix spurious exit from input read loop on EINTR.
authorCsaba Kos <csaba.kos@gmail.com>
Fri, 30 May 2014 09:40:15 +0000 (18:40 +0900)
committerKarel Zak <kzak@redhat.com>
Mon, 2 Jun 2014 08:14:30 +0000 (10:14 +0200)
term-utils/script.c

index 47bb186bf8354e7d9f762ca5b08144dc8394233f..1ae34627f759675d1820c074b7101a8f136ced28 100644 (file)
@@ -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;
                }