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