summaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-10-13 16:22:09 +0200
committerBram Moolenaar <Bram@vim.org>2010-10-13 16:22:09 +0200
commit624891f3ef6a292b10bb17eccc48cbc6351aa1ba (patch)
tree1e516623c17ec4e5a21b3fecf2c7054dd6046baf /src/os_unix.c
parentd5784f9fc4e163f0d28f96b5bb45423a5d5a719b (diff)
downloadvim-git-624891f3ef6a292b10bb17eccc48cbc6351aa1ba.tar.gz
updated for version 7.3.023v7.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)
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index b0e0f0211..150bdad6d 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)