To: vim_dev@googlegroups.com Subject: Patch 7.4.1174 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1174 Problem: Netbeans contains dead code insde #ifndef INIT_SOCKETS. Solution: Remove the dead code. Files: src/netbeans.c *** ../vim-7.4.1173/src/netbeans.c 2016-01-24 20:36:18.854082474 +0100 --- src/netbeans.c 2016-01-24 22:14:35.800374527 +0100 *************** *** 27,35 **** #if defined(FEAT_NETBEANS_INTG) || defined(PROTO) - /* TODO: when should this not be defined? */ - #define INET_SOCKETS - /* Note: when making changes here also adjust configure.in. */ #ifdef WIN32 # ifdef DEBUG --- 27,32 ---- *************** *** 49,60 **** # define sock_close(sd) closesocket(sd) # define sleep(t) Sleep(t*1000) /* WinAPI Sleep() accepts milliseconds */ #else ! # ifdef INET_SOCKETS ! # include ! # include ! # else ! # include ! # endif # include # ifdef HAVE_LIBGEN_H --- 46,53 ---- # define sock_close(sd) closesocket(sd) # define sleep(t) Sleep(t*1000) /* WinAPI Sleep() accepts milliseconds */ #else ! # include ! # include # include # ifdef HAVE_LIBGEN_H *************** *** 216,231 **** static int netbeans_connect(char *params, int doabort) { - #ifdef INET_SOCKETS struct sockaddr_in server; struct hostent * host; ! # ifdef FEAT_GUI_W32 u_short port; - # else - int port; - # endif #else ! struct sockaddr_un server; #endif int sd; char buf[32]; --- 209,220 ---- static int netbeans_connect(char *params, int doabort) { struct sockaddr_in server; struct hostent * host; ! #ifdef FEAT_GUI_W32 u_short port; #else ! int port; #endif int sd; char buf[32]; *************** *** 309,315 **** channel_init_winsock(); #endif - #ifdef INET_SOCKETS port = atoi(address); if ((sd = (sock_T)socket(AF_INET, SOCK_STREAM, 0)) == (sock_T)-1) --- 298,303 ---- *************** *** 332,348 **** goto theend; } memcpy((char *)&server.sin_addr, host->h_addr, host->h_length); - #else - if ((sd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) - { - nbdebug(("error in socket() in netbeans_connect()\n")); - PERROR("socket() in netbeans_connect()"); - goto theend; - } - - server.sun_family = AF_UNIX; - strcpy(server.sun_path, address); - #endif /* Connect to server */ if (connect(sd, (struct sockaddr *)&server, sizeof(server))) { --- 320,325 ---- *************** *** 351,357 **** if (errno == ECONNREFUSED) { sock_close(sd); - #ifdef INET_SOCKETS if ((sd = (sock_T)socket(AF_INET, SOCK_STREAM, 0)) == (sock_T)-1) { SOCK_ERRNO; --- 328,333 ---- *************** *** 359,373 **** PERROR("socket()#2 in netbeans_connect()"); goto theend; } - #else - if ((sd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) - { - SOCK_ERRNO; - nbdebug(("socket()#2 in netbeans_connect()\n")); - PERROR("socket()#2 in netbeans_connect()"); - goto theend; - } - #endif if (connect(sd, (struct sockaddr *)&server, sizeof(server))) { int retries = 36; --- 335,340 ---- *** ../vim-7.4.1173/src/version.c 2016-01-24 21:51:52.838704254 +0100 --- src/version.c 2016-01-24 22:15:19.419916336 +0100 *************** *** 743,744 **** --- 743,746 ---- { /* Add new patch number below this line */ + /**/ + 1174, /**/ -- You have the right to remain silent. Anything you say will be misquoted, then used against you. /// 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 ///