]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.096 v7.3.096
authorBram Moolenaar <Bram@vim.org>
Tue, 4 Jan 2011 17:11:43 +0000 (18:11 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 4 Jan 2011 17:11:43 +0000 (18:11 +0100)
Problem:    "gvim -nb" is not interruptable.  Leaking file descriptor on
            netbeans connection error.
Solution:   Check for CTRL-C typed.  Free file descriptor.  (Xavier de Gaye)

src/netbeans.c
src/version.c

index 71b664cbfb5f1b7524c0fa7c952972c43be8694e..01cb5fbe29ae0d42108e2c572891ca9055bf91c3 100644 (file)
@@ -321,6 +321,7 @@ netbeans_connect(char *params, int doabort)
     {
        nbdebug(("error in gethostbyname() in netbeans_connect()\n"));
        PERROR("gethostbyname() in netbeans_connect()");
+       sock_close(sd);
        goto theend;
     }
     memcpy((char *)&server.sin_addr, host->h_addr, host->h_length);
@@ -370,15 +371,12 @@ netbeans_connect(char *params, int doabort)
                                                         || (errno == EINTR)))
                {
                    nbdebug(("retrying...\n"));
-                   sleep(5);
-                   if (!doabort)
+                   mch_delay(3000L, TRUE);
+                   ui_breakcheck();
+                   if (got_int)
                    {
-                       ui_breakcheck();
-                       if (got_int)
-                       {
-                           errno = EINTR;
-                           break;
-                       }
+                       errno = EINTR;
+                       break;
                    }
                    if (connect(sd, (struct sockaddr *)&server,
                                                         sizeof(server)) == 0)
@@ -393,6 +391,7 @@ netbeans_connect(char *params, int doabort)
                    /* Get here when the server can't be found. */
                    nbdebug(("Cannot connect to Netbeans #2\n"));
                    PERROR(_("Cannot connect to Netbeans #2"));
+                   sock_close(sd);
                    if (doabort)
                        getout(1);
                    goto theend;
@@ -403,6 +402,7 @@ netbeans_connect(char *params, int doabort)
        {
            nbdebug(("Cannot connect to Netbeans\n"));
            PERROR(_("Cannot connect to Netbeans"));
+           sock_close(sd);
            if (doabort)
                getout(1);
            goto theend;
index 2873adb51fd48d6a77ba2cfbc9cf5393debe4d56..3e56bdf3b1aaf02308759452d82fc06f67c0f6e2 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    96,
 /**/
     95,
 /**/