86b7036
To: vim_dev@googlegroups.com
86b7036
Subject: Patch 7.3.096
86b7036
Fcc: outbox
86b7036
From: Bram Moolenaar <Bram@moolenaar.net>
86b7036
Mime-Version: 1.0
86b7036
Content-Type: text/plain; charset=UTF-8
86b7036
Content-Transfer-Encoding: 8bit
86b7036
------------
86b7036
86b7036
Patch 7.3.096
86b7036
Problem:    "gvim -nb" is not interruptable.  Leaking file descriptor on
86b7036
	    netbeans connection error.
86b7036
Solution:   Check for CTRL-C typed.  Free file descriptor.  (Xavier de Gaye)
86b7036
Files:	    src/netbeans.c
86b7036
86b7036
86b7036
*** ../vim-7.3.095/src/netbeans.c	2010-12-24 14:00:09.000000000 +0100
86b7036
--- src/netbeans.c	2011-01-04 18:00:35.000000000 +0100
86b7036
***************
86b7036
*** 321,326 ****
86b7036
--- 321,327 ----
86b7036
      {
86b7036
  	nbdebug(("error in gethostbyname() in netbeans_connect()\n"));
86b7036
  	PERROR("gethostbyname() in netbeans_connect()");
86b7036
+ 	sock_close(sd);
86b7036
  	goto theend;
86b7036
      }
86b7036
      memcpy((char *)&server.sin_addr, host->h_addr, host->h_length);
86b7036
***************
86b7036
*** 370,384 ****
86b7036
  							 || (errno == EINTR)))
86b7036
  		{
86b7036
  		    nbdebug(("retrying...\n"));
86b7036
! 		    sleep(5);
86b7036
! 		    if (!doabort)
86b7036
  		    {
86b7036
! 			ui_breakcheck();
86b7036
! 			if (got_int)
86b7036
! 			{
86b7036
! 			    errno = EINTR;
86b7036
! 			    break;
86b7036
! 			}
86b7036
  		    }
86b7036
  		    if (connect(sd, (struct sockaddr *)&server,
86b7036
  							 sizeof(server)) == 0)
86b7036
--- 371,382 ----
86b7036
  							 || (errno == EINTR)))
86b7036
  		{
86b7036
  		    nbdebug(("retrying...\n"));
86b7036
! 		    mch_delay(3000L, TRUE);
86b7036
! 		    ui_breakcheck();
86b7036
! 		    if (got_int)
86b7036
  		    {
86b7036
! 			errno = EINTR;
86b7036
! 			break;
86b7036
  		    }
86b7036
  		    if (connect(sd, (struct sockaddr *)&server,
86b7036
  							 sizeof(server)) == 0)
86b7036
***************
86b7036
*** 393,398 ****
86b7036
--- 391,397 ----
86b7036
  		    /* Get here when the server can't be found. */
86b7036
  		    nbdebug(("Cannot connect to Netbeans #2\n"));
86b7036
  		    PERROR(_("Cannot connect to Netbeans #2"));
86b7036
+ 		    sock_close(sd);
86b7036
  		    if (doabort)
86b7036
  			getout(1);
86b7036
  		    goto theend;
86b7036
***************
86b7036
*** 403,408 ****
86b7036
--- 402,408 ----
86b7036
  	{
86b7036
  	    nbdebug(("Cannot connect to Netbeans\n"));
86b7036
  	    PERROR(_("Cannot connect to Netbeans"));
86b7036
+ 	    sock_close(sd);
86b7036
  	    if (doabort)
86b7036
  		getout(1);
86b7036
  	    goto theend;
86b7036
*** ../vim-7.3.095/src/version.c	2011-01-04 17:49:25.000000000 +0100
86b7036
--- src/version.c	2011-01-04 18:09:46.000000000 +0100
86b7036
***************
86b7036
*** 716,717 ****
86b7036
--- 716,719 ----
86b7036
  {   /* Add new patch number below this line */
86b7036
+ /**/
86b7036
+     96,
86b7036
  /**/
86b7036
86b7036
-- 
86b7036
hundred-and-one symptoms of being an internet addict:
86b7036
85. Choice between paying Compuserve bill and paying for kids education
86b7036
    is a no brainer -- although a bit painful for your kids.
86b7036
86b7036
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
86b7036
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
86b7036
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
86b7036
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///