summaryrefslogtreecommitdiff
path: root/source/ap/vim/patches/7.3.060
diff options
context:
space:
mode:
authorPatrick J Volkerding <volkerdi@slackware.com>2011-04-25 13:37:00 +0000
committerEric Hameleers <alien@slackware.com>2018-05-31 22:45:18 +0200
commit75a4a592e5ccda30715f93563d741b83e0dcf39e (patch)
tree502f745607e77a2c4386ad38d818ddcafe81489c /source/ap/vim/patches/7.3.060
parentb76270bf9e6dd375e495fec92140a79a79415d27 (diff)
downloadcurrent-75a4a592e5ccda30715f93563d741b83e0dcf39e.tar.gz
Slackware 13.37slackware-13.37
Mon Apr 25 13:37:00 UTC 2011 Slackware 13.37 x86_64 stable is released! Thanks to everyone who pitched in on this release: the Slackware team, the folks producing upstream code, and linuxquestions.org for providing a great forum for collaboration and testing. The ISOs are off to be replicated, a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. Please consider supporting the Slackware project by picking up a copy from store.slackware.com. We're taking pre-orders now, and offer a discount if you sign up for a subscription. As always, thanks to the Slackware community for testing, suggestions, and feedback. :-) Have fun!
Diffstat (limited to 'source/ap/vim/patches/7.3.060')
-rw-r--r--source/ap/vim/patches/7.3.060227
1 files changed, 227 insertions, 0 deletions
diff --git a/source/ap/vim/patches/7.3.060 b/source/ap/vim/patches/7.3.060
new file mode 100644
index 00000000..0edf20ce
--- /dev/null
+++ b/source/ap/vim/patches/7.3.060
@@ -0,0 +1,227 @@
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.060
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.060
+Problem: Netbeans: crash when socket is disconnected unexpectedly.
+Solution: Don't cleanup when a read fails, put a message in the queue and
+ disconnect later. (Xavier de Gaye)
+Files: src/netbeans.c
+
+
+*** ../vim-7.3.059/src/netbeans.c 2010-11-16 15:04:51.000000000 +0100
+--- src/netbeans.c 2010-11-16 15:48:36.000000000 +0100
+***************
+*** 135,148 ****
+ static int needupdate = 0;
+ static int inAtomic = 0;
+
+ static void
+! netbeans_close(void)
+ {
+- if (!NETBEANS_OPEN)
+- return;
+-
+- netbeans_send_disconnect();
+-
+ #ifdef FEAT_GUI_X11
+ if (inputHandler != (XtInputId)NULL)
+ {
+--- 135,146 ----
+ static int needupdate = 0;
+ static int inAtomic = 0;
+
++ /*
++ * Close the socket and remove the input handlers.
++ */
+ static void
+! nb_close_socket(void)
+ {
+ #ifdef FEAT_GUI_X11
+ if (inputHandler != (XtInputId)NULL)
+ {
+***************
+*** 167,179 ****
+ # endif
+ #endif
+
+ #ifdef FEAT_BEVAL
+ bevalServers &= ~BEVAL_NETBEANS;
+ #endif
+
+- sock_close(nbsock);
+- nbsock = -1;
+-
+ needupdate = 0;
+ inAtomic = 0;
+ nb_free();
+--- 165,191 ----
+ # endif
+ #endif
+
++ sock_close(nbsock);
++ nbsock = -1;
++ }
++
++ /*
++ * Close the connection and cleanup.
++ * May be called when nb_close_socket() was called earlier.
++ */
++ static void
++ netbeans_close(void)
++ {
++ if (NETBEANS_OPEN)
++ {
++ netbeans_send_disconnect();
++ nb_close_socket();
++ }
++
+ #ifdef FEAT_BEVAL
+ bevalServers &= ~BEVAL_NETBEANS;
+ #endif
+
+ needupdate = 0;
+ inAtomic = 0;
+ nb_free();
+***************
+*** 632,640 ****
+ char_u *p;
+ queue_T *node;
+
+- if (!NETBEANS_OPEN)
+- return;
+-
+ while (head.next != NULL && head.next != &head)
+ {
+ node = head.next;
+--- 644,649 ----
+***************
+*** 720,725 ****
+--- 729,736 ----
+ }
+ #endif
+
++ #define DETACH_MSG "DETACH\n"
++
+ void
+ netbeans_read()
+ {
+***************
+*** 780,801 ****
+ break; /* did read everything that's available */
+ }
+
+ if (readlen <= 0)
+ {
+! /* read error or didn't read anything */
+! netbeans_close();
+! nbdebug(("messageFromNetbeans: Error in read() from socket\n"));
+ if (len < 0)
+ {
+ nbdebug(("read from Netbeans socket\n"));
+ PERROR(_("read from Netbeans socket"));
+ }
+- return; /* don't try to parse it */
+ }
+
+ #if defined(NB_HAS_GUI) && defined(FEAT_GUI_GTK)
+ if (NB_HAS_GUI && gtk_main_level() > 0)
+! gtk_main_quit();
+ #endif
+ }
+
+--- 791,822 ----
+ break; /* did read everything that's available */
+ }
+
++ /* Reading a socket disconnection (readlen == 0), or a socket error. */
+ if (readlen <= 0)
+ {
+! /* Queue a "DETACH" netbeans message in the command queue in order to
+! * terminate the netbeans session later. Do not end the session here
+! * directly as we may be running in the context of a call to
+! * netbeans_parse_messages():
+! * netbeans_parse_messages
+! * -> autocmd triggered while processing the netbeans cmd
+! * -> ui_breakcheck
+! * -> gui event loop or select loop
+! * -> netbeans_read()
+! */
+! save((char_u *)DETACH_MSG, strlen(DETACH_MSG));
+! nb_close_socket();
+!
+ if (len < 0)
+ {
+ nbdebug(("read from Netbeans socket\n"));
+ PERROR(_("read from Netbeans socket"));
+ }
+ }
+
+ #if defined(NB_HAS_GUI) && defined(FEAT_GUI_GTK)
+ if (NB_HAS_GUI && gtk_main_level() > 0)
+! gtk_main_quit();
+ #endif
+ }
+
+***************
+*** 1164,1169 ****
+--- 1185,1194 ----
+
+ nbdebug(("REP %d: <none>\n", cmdno));
+
++ /* Avoid printing an annoying error message. */
++ if (!NETBEANS_OPEN)
++ return;
++
+ sprintf(reply, "%d\n", cmdno);
+ nb_send(reply, "nb_reply_nil");
+ }
+***************
+*** 2753,2763 ****
+ {
+ #ifdef FEAT_GUI
+ # if !defined(FEAT_GUI_X11) && !defined(FEAT_GUI_GTK) \
+! && !defined(FEAT_GUI_W32)
+ if (gui.in_use)
+ {
+! EMSG(_("E838: netbeans is not supported with this GUI"));
+! return;
+ }
+ # endif
+ #endif
+--- 2778,2788 ----
+ {
+ #ifdef FEAT_GUI
+ # if !defined(FEAT_GUI_X11) && !defined(FEAT_GUI_GTK) \
+! && !defined(FEAT_GUI_W32)
+ if (gui.in_use)
+ {
+! EMSG(_("E838: netbeans is not supported with this GUI"));
+! return;
+ }
+ # endif
+ #endif
+*** ../vim-7.3.059/src/version.c 2010-11-16 15:04:51.000000000 +0100
+--- src/version.c 2010-11-16 15:22:39.000000000 +0100
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 60,
+ /**/
+
+--
+ Another bucket of what can only be described as human ordure hits ARTHUR.
+ARTHUR: ... Right! (to the KNIGHTS) That settles it!
+ "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///