Karsten Hopp 5c7d2f
To: vim_dev@googlegroups.com
Karsten Hopp 5c7d2f
Subject: Patch 7.3.295
Karsten Hopp 5c7d2f
Fcc: outbox
Karsten Hopp 5c7d2f
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 5c7d2f
Mime-Version: 1.0
Karsten Hopp 5c7d2f
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 5c7d2f
Content-Transfer-Encoding: 8bit
Karsten Hopp 5c7d2f
------------
Karsten Hopp 5c7d2f
Karsten Hopp 5c7d2f
Patch 7.3.295
Karsten Hopp 5c7d2f
Problem:    When filtering text with an external command Vim may not read all
Karsten Hopp 5c7d2f
	    the output.
Karsten Hopp 5c7d2f
Solution:   When select() is interrupted loop and try again. (James Vega)
Karsten Hopp 5c7d2f
Files:	    src/os_unix.c
Karsten Hopp 5c7d2f
Karsten Hopp 5c7d2f
Karsten Hopp 5c7d2f
*** ../vim-7.3.294/src/os_unix.c	2011-08-04 20:31:50.000000000 +0200
Karsten Hopp 5c7d2f
--- src/os_unix.c	2011-09-07 13:34:09.000000000 +0200
Karsten Hopp 5c7d2f
***************
Karsten Hopp 5c7d2f
*** 4819,4825 ****
Karsten Hopp 5c7d2f
  
Karsten Hopp 5c7d2f
  /*
Karsten Hopp 5c7d2f
   * Wait "msec" msec until a character is available from file descriptor "fd".
Karsten Hopp 5c7d2f
!  * Time == -1 will block forever.
Karsten Hopp 5c7d2f
   * When a GUI is being used, this will not be used for input -- webb
Karsten Hopp 5c7d2f
   * Returns also, when a request from Sniff is waiting -- toni.
Karsten Hopp 5c7d2f
   * Or when a Linux GPM mouse event is waiting.
Karsten Hopp 5c7d2f
--- 4819,4826 ----
Karsten Hopp 5c7d2f
  
Karsten Hopp 5c7d2f
  /*
Karsten Hopp 5c7d2f
   * Wait "msec" msec until a character is available from file descriptor "fd".
Karsten Hopp 5c7d2f
!  * "msec" == 0 will check for characters once.
Karsten Hopp 5c7d2f
!  * "msec" == -1 will block until a character is available.
Karsten Hopp 5c7d2f
   * When a GUI is being used, this will not be used for input -- webb
Karsten Hopp 5c7d2f
   * Returns also, when a request from Sniff is waiting -- toni.
Karsten Hopp 5c7d2f
   * Or when a Linux GPM mouse event is waiting.
Karsten Hopp 5c7d2f
***************
Karsten Hopp 5c7d2f
*** 5057,5063 ****
Karsten Hopp 5c7d2f
  	/*
Karsten Hopp 5c7d2f
  	 * Select on ready for reading and exceptional condition (end of file).
Karsten Hopp 5c7d2f
  	 */
Karsten Hopp 5c7d2f
! 	FD_ZERO(&rfds); /* calls bzero() on a sun */
Karsten Hopp 5c7d2f
  	FD_ZERO(&efds);
Karsten Hopp 5c7d2f
  	FD_SET(fd, &rfds);
Karsten Hopp 5c7d2f
  # if !defined(__QNX__) && !defined(__CYGWIN32__)
Karsten Hopp 5c7d2f
--- 5058,5065 ----
Karsten Hopp 5c7d2f
  	/*
Karsten Hopp 5c7d2f
  	 * Select on ready for reading and exceptional condition (end of file).
Karsten Hopp 5c7d2f
  	 */
Karsten Hopp 5c7d2f
! select_eintr:
Karsten Hopp 5c7d2f
! 	FD_ZERO(&rfds);
Karsten Hopp 5c7d2f
  	FD_ZERO(&efds);
Karsten Hopp 5c7d2f
  	FD_SET(fd, &rfds);
Karsten Hopp 5c7d2f
  # if !defined(__QNX__) && !defined(__CYGWIN32__)
Karsten Hopp 5c7d2f
***************
Karsten Hopp 5c7d2f
*** 5117,5122 ****
Karsten Hopp 5c7d2f
--- 5119,5132 ----
Karsten Hopp 5c7d2f
  # else
Karsten Hopp 5c7d2f
  	ret = select(maxfd + 1, &rfds, NULL, &efds, tvp);
Karsten Hopp 5c7d2f
  # endif
Karsten Hopp 5c7d2f
+ # ifdef EINTR
Karsten Hopp 5c7d2f
+ 	if (ret == -1 && errno == EINTR)
Karsten Hopp 5c7d2f
+ 	    /* Interrupted by a signal, need to try again.  We ignore msec
Karsten Hopp 5c7d2f
+ 	     * here, because we do want to check even after a timeout if
Karsten Hopp 5c7d2f
+ 	     * characters are available.  Needed for reading output of an
Karsten Hopp 5c7d2f
+ 	     * external command after the process has finished. */
Karsten Hopp 5c7d2f
+ 	    goto select_eintr;
Karsten Hopp 5c7d2f
+ # endif
Karsten Hopp 5c7d2f
  # ifdef __TANDEM
Karsten Hopp 5c7d2f
  	if (ret == -1 && errno == ENOTSUP)
Karsten Hopp 5c7d2f
  	{
Karsten Hopp 5c7d2f
***************
Karsten Hopp 5c7d2f
*** 5124,5130 ****
Karsten Hopp 5c7d2f
  	    FD_ZERO(&efds);
Karsten Hopp 5c7d2f
  	    ret = 0;
Karsten Hopp 5c7d2f
  	}
Karsten Hopp 5c7d2f
! #endif
Karsten Hopp 5c7d2f
  # ifdef FEAT_MZSCHEME
Karsten Hopp 5c7d2f
  	if (ret == 0 && mzquantum_used)
Karsten Hopp 5c7d2f
  	    /* loop if MzThreads must be scheduled and timeout occurred */
Karsten Hopp 5c7d2f
--- 5134,5140 ----
Karsten Hopp 5c7d2f
  	    FD_ZERO(&efds);
Karsten Hopp 5c7d2f
  	    ret = 0;
Karsten Hopp 5c7d2f
  	}
Karsten Hopp 5c7d2f
! # endif
Karsten Hopp 5c7d2f
  # ifdef FEAT_MZSCHEME
Karsten Hopp 5c7d2f
  	if (ret == 0 && mzquantum_used)
Karsten Hopp 5c7d2f
  	    /* loop if MzThreads must be scheduled and timeout occurred */
Karsten Hopp 5c7d2f
*** ../vim-7.3.294/src/version.c	2011-09-05 20:13:37.000000000 +0200
Karsten Hopp 5c7d2f
--- src/version.c	2011-09-07 14:05:05.000000000 +0200
Karsten Hopp 5c7d2f
***************
Karsten Hopp 5c7d2f
*** 711,712 ****
Karsten Hopp 5c7d2f
--- 711,714 ----
Karsten Hopp 5c7d2f
  {   /* Add new patch number below this line */
Karsten Hopp 5c7d2f
+ /**/
Karsten Hopp 5c7d2f
+     295,
Karsten Hopp 5c7d2f
  /**/
Karsten Hopp 5c7d2f
Karsten Hopp 5c7d2f
-- 
Karsten Hopp 5c7d2f
"You're fired." (1980)
Karsten Hopp 5c7d2f
"You're laid off." (1985)
Karsten Hopp 5c7d2f
"You're downsized." (1990)
Karsten Hopp 5c7d2f
"You're rightsized." (1992)
Karsten Hopp 5c7d2f
				(Scott Adams - The Dilbert principle)
Karsten Hopp 5c7d2f
Karsten Hopp 5c7d2f
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 5c7d2f
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 5c7d2f
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 5c7d2f
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///