025475f
To: vim-dev@vim.org
025475f
Subject: Patch 7.3.023
025475f
Fcc: outbox
025475f
From: Bram Moolenaar <Bram@moolenaar.net>
025475f
Mime-Version: 1.0
025475f
Content-Type: text/plain; charset=UTF-8
025475f
Content-Transfer-Encoding: 8bit
025475f
------------
025475f
025475f
Patch 7.3.023
025475f
Problem:    External program may hang when it tries to write to the tty.
025475f
Solution:   Don't close the slave tty until after the child exits. (Nikola
025475f
	    Knezevic)
025475f
Files:	    src/os_unix.c
025475f
025475f
025475f
*** ../vim-7.3.022/src/os_unix.c	2010-09-21 22:09:28.000000000 +0200
025475f
--- src/os_unix.c	2010-10-13 16:17:33.000000000 +0200
025475f
***************
025475f
*** 4168,4174 ****
025475f
  # ifdef FEAT_GUI
025475f
  		if (pty_master_fd >= 0)
025475f
  		{
025475f
- 		    close(pty_slave_fd);	/* close slave side of pty */
025475f
  		    fromshell_fd = pty_master_fd;
025475f
  		    toshell_fd = dup(pty_master_fd);
025475f
  		}
025475f
--- 4168,4173 ----
025475f
***************
025475f
*** 4637,4642 ****
025475f
--- 4636,4649 ----
025475f
  		    break;
025475f
  	    }
025475f
  
025475f
+ # ifdef FEAT_GUI
025475f
+ 	    /* Close slave side of pty.  Only do this after the child has
025475f
+ 	     * exited, otherwise the child may hang when it tries to write on
025475f
+ 	     * the pty. */
025475f
+ 	    if (pty_master_fd >= 0)
025475f
+ 		close(pty_slave_fd);
025475f
+ # endif
025475f
+ 
025475f
  	    /* Make sure the child that writes to the external program is
025475f
  	     * dead. */
025475f
  	    if (wpid > 0)
025475f
*** ../vim-7.3.022/src/version.c	2010-10-13 14:05:29.000000000 +0200
025475f
--- src/version.c	2010-10-13 16:20:48.000000000 +0200
025475f
***************
025475f
*** 716,717 ****
025475f
--- 716,719 ----
025475f
  {   /* Add new patch number below this line */
025475f
+ /**/
025475f
+     23,
025475f
  /**/
025475f
025475f
-- 
025475f
       We're knights of the Round Table
025475f
       Our shows are formidable
025475f
       But many times
025475f
       We're given rhymes
025475f
       That are quite unsingable
025475f
       We're opera mad in Camelot
025475f
       We sing from the diaphragm a lot.
025475f
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
025475f
025475f
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
025475f
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
025475f
\\\        download, build and distribute -- http://www.A-A-P.org        ///
025475f
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///