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