Mercurial > vim
changeset 2600:d982226b7aaa v7.3.023
updated for version 7.3.023
Problem: External program may hang when it tries to write to the tty.
Solution: Don't close the slave tty until after the child exits. (Nikola
Knezevic)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 13 Oct 2010 16:22:09 +0200 |
parents | 8aa94f8080bd |
children | 1baac9d06c83 |
files | src/os_unix.c src/version.c |
diffstat | 2 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/os_unix.c +++ b/src/os_unix.c @@ -4168,7 +4168,6 @@ mch_call_shell(cmd, options) # ifdef FEAT_GUI if (pty_master_fd >= 0) { - close(pty_slave_fd); /* close slave side of pty */ fromshell_fd = pty_master_fd; toshell_fd = dup(pty_master_fd); } @@ -4637,6 +4636,14 @@ finished: break; } +# ifdef FEAT_GUI + /* Close slave side of pty. Only do this after the child has + * exited, otherwise the child may hang when it tries to write on + * the pty. */ + if (pty_master_fd >= 0) + close(pty_slave_fd); +# endif + /* Make sure the child that writes to the external program is * dead. */ if (wpid > 0)