summaryrefslogtreecommitdiffstats
path: root/term-utils
diff options
context:
space:
mode:
authorCsaba Kos2014-05-30 11:40:15 +0200
committerKarel Zak2014-06-02 10:14:30 +0200
commit578a1691f6d9d66799634c94687c849289f3fc36 (patch)
treef3d30a7feb6eddc59b0beb5a8342998ad55023f8 /term-utils
parentscript: fix a rare deadlock after child termination (diff)
downloadkernel-qcow2-util-linux-578a1691f6d9d66799634c94687c849289f3fc36.tar.gz
kernel-qcow2-util-linux-578a1691f6d9d66799634c94687c849289f3fc36.tar.xz
kernel-qcow2-util-linux-578a1691f6d9d66799634c94687c849289f3fc36.zip
script: fix spurious exit from input read loop on EINTR.
Diffstat (limited to 'term-utils')
-rw-r--r--term-utils/script.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/term-utils/script.c b/term-utils/script.c
index 47bb186bf..1ae34627f 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;
}