mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-13 23:31:08 +02:00
32131: avoid infinite loop reading pty on platforms that do not buffer output after child exit
This commit is contained in:
parent
db23c63005
commit
feae6af6d2
2 changed files with 8 additions and 2 deletions
|
@ -11,6 +11,12 @@
|
||||||
allows you to make the right prompt flush if your terminal
|
allows you to make the right prompt flush if your terminal
|
||||||
supports it.
|
supports it.
|
||||||
|
|
||||||
|
2013-12-16 Barton E. Schaefer <schaefer@zsh.org>
|
||||||
|
|
||||||
|
* Jun Takimoto + Bart: 32131: Src/Modules/zpty.c: avoid infinite
|
||||||
|
loop reading pseudo-terminal on platforms that do not buffer pty
|
||||||
|
contents after child process exits
|
||||||
|
|
||||||
2013-12-15 Barton E. Schaefer <schaefer@zsh.org>
|
2013-12-15 Barton E. Schaefer <schaefer@zsh.org>
|
||||||
|
|
||||||
* users/18219: Completion/Zsh/Type/_command_names: compadd -Q for
|
* users/18219: Completion/Zsh/Type/_command_names: compadd -Q for
|
||||||
|
|
|
@ -510,14 +510,14 @@ checkptycmd(Ptycmd cmd)
|
||||||
|
|
||||||
if (cmd->read != -1 || cmd->fin)
|
if (cmd->read != -1 || cmd->fin)
|
||||||
return;
|
return;
|
||||||
if ((r = read(cmd->fd, &c, 1)) < 0) {
|
if ((r = read(cmd->fd, &c, 1)) <= 0) {
|
||||||
if (kill(cmd->pid, 0) < 0) {
|
if (kill(cmd->pid, 0) < 0) {
|
||||||
cmd->fin = 1;
|
cmd->fin = 1;
|
||||||
zclose(cmd->fd);
|
zclose(cmd->fd);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (r) cmd->read = (int) c;
|
cmd->read = (int) c;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
Loading…
Reference in a new issue