diff options
author | Bram Moolenaar <bram@vim.org> | 2010-10-13 16:22:09 +0200 |
---|---|---|
committer | Bram Moolenaar <bram@vim.org> | 2010-10-13 16:22:09 +0200 |
commit | 5946174c4d09bd270bf9d043c7b451ac43097807 (patch) | |
tree | 7b1ee6132160789e1d3d4f1fd824f122e371d9ca | |
parent | 791f57724907eaaee488aa33e6c5d690ea7ff43f (diff) | |
download | vim-5946174c4d09bd270bf9d043c7b451ac43097807.tar.gz |
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)
-rw-r--r-- | src/os_unix.c | 9 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index b0e0f021..150bdad6 100644 --- 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) diff --git a/src/version.c b/src/version.c index 9db3fce9..6b7742e9 100644 --- a/src/version.c +++ b/src/version.c @@ -715,6 +715,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 23, +/**/ 22, /**/ 21, |