0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

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)
This commit is contained in:
Bram Moolenaar
2010-10-13 16:22:09 +02:00
parent d5784f9fc4
commit 624891f3ef
2 changed files with 10 additions and 1 deletions

View File

@@ -4168,7 +4168,6 @@ mch_call_shell(cmd, options)
# ifdef FEAT_GUI # ifdef FEAT_GUI
if (pty_master_fd >= 0) if (pty_master_fd >= 0)
{ {
close(pty_slave_fd); /* close slave side of pty */
fromshell_fd = pty_master_fd; fromshell_fd = pty_master_fd;
toshell_fd = dup(pty_master_fd); toshell_fd = dup(pty_master_fd);
} }
@@ -4637,6 +4636,14 @@ finished:
break; 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 /* Make sure the child that writes to the external program is
* dead. */ * dead. */
if (wpid > 0) if (wpid > 0)

View File

@@ -714,6 +714,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
23,
/**/ /**/
22, 22,
/**/ /**/