mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-14 01:51:22 +02:00
12222: handle EINTR for multios helper processes
This commit is contained in:
parent
32d2d47fd5
commit
6c1110da32
1 changed files with 16 additions and 2 deletions
18
Src/exec.c
18
Src/exec.c
|
@ -1356,15 +1356,29 @@ closemn(struct multio **mfds, int fd)
|
||||||
closeallelse(mn);
|
closeallelse(mn);
|
||||||
if (mn->rflag) {
|
if (mn->rflag) {
|
||||||
/* tee process */
|
/* tee process */
|
||||||
while ((len = read(mn->pipe, buf, TCBUFSIZE)) > 0)
|
while ((len = read(mn->pipe, buf, TCBUFSIZE)) != 0) {
|
||||||
|
if (len < 0) {
|
||||||
|
if (errno == EINTR)
|
||||||
|
continue;
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
for (i = 0; i < mn->ct; i++)
|
for (i = 0; i < mn->ct; i++)
|
||||||
write(mn->fds[i], buf, len);
|
write(mn->fds[i], buf, len);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* cat process */
|
/* cat process */
|
||||||
for (i = 0; i < mn->ct; i++)
|
for (i = 0; i < mn->ct; i++)
|
||||||
while ((len = read(mn->fds[i], buf, TCBUFSIZE)) > 0)
|
while ((len = read(mn->fds[i], buf, TCBUFSIZE)) != 0) {
|
||||||
|
if (len < 0) {
|
||||||
|
if (errno == EINTR)
|
||||||
|
continue;
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
write(mn->pipe, buf, len);
|
write(mn->pipe, buf, len);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
_exit(0);
|
_exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue