Skip to content

Commit 3e53c70

Browse files
committed
patch 7.4.1174
Problem: Netbeans contains dead code insde #ifdef. Solution: Remove the dead code.
1 parent 6559100 commit 3e53c70

2 files changed

Lines changed: 6 additions & 37 deletions

File tree

src/netbeans.c

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727

2828
#if defined(FEAT_NETBEANS_INTG) || defined(PROTO)
2929

30-
/* TODO: when should this not be defined? */
31-
#define INET_SOCKETS
32-
3330
/* Note: when making changes here also adjust configure.in. */
3431
#ifdef WIN32
3532
# ifdef DEBUG
@@ -49,12 +46,8 @@
4946
# define sock_close(sd) closesocket(sd)
5047
# define sleep(t) Sleep(t*1000) /* WinAPI Sleep() accepts milliseconds */
5148
#else
52-
# ifdef INET_SOCKETS
53-
# include <netdb.h>
54-
# include <netinet/in.h>
55-
# else
56-
# include <sys/un.h>
57-
# endif
49+
# include <netdb.h>
50+
# include <netinet/in.h>
5851

5952
# include <sys/socket.h>
6053
# ifdef HAVE_LIBGEN_H
@@ -216,16 +209,12 @@ netbeans_close(void)
216209
static int
217210
netbeans_connect(char *params, int doabort)
218211
{
219-
#ifdef INET_SOCKETS
220212
struct sockaddr_in server;
221213
struct hostent * host;
222-
# ifdef FEAT_GUI_W32
214+
#ifdef FEAT_GUI_W32
223215
u_short port;
224-
# else
225-
int port;
226-
# endif
227216
#else
228-
struct sockaddr_un server;
217+
int port;
229218
#endif
230219
int sd;
231220
char buf[32];
@@ -309,7 +298,6 @@ netbeans_connect(char *params, int doabort)
309298
channel_init_winsock();
310299
#endif
311300

312-
#ifdef INET_SOCKETS
313301
port = atoi(address);
314302

315303
if ((sd = (sock_T)socket(AF_INET, SOCK_STREAM, 0)) == (sock_T)-1)
@@ -332,17 +320,6 @@ netbeans_connect(char *params, int doabort)
332320
goto theend;
333321
}
334322
memcpy((char *)&server.sin_addr, host->h_addr, host->h_length);
335-
#else
336-
if ((sd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
337-
{
338-
nbdebug(("error in socket() in netbeans_connect()\n"));
339-
PERROR("socket() in netbeans_connect()");
340-
goto theend;
341-
}
342-
343-
server.sun_family = AF_UNIX;
344-
strcpy(server.sun_path, address);
345-
#endif
346323
/* Connect to server */
347324
if (connect(sd, (struct sockaddr *)&server, sizeof(server)))
348325
{
@@ -351,23 +328,13 @@ netbeans_connect(char *params, int doabort)
351328
if (errno == ECONNREFUSED)
352329
{
353330
sock_close(sd);
354-
#ifdef INET_SOCKETS
355331
if ((sd = (sock_T)socket(AF_INET, SOCK_STREAM, 0)) == (sock_T)-1)
356332
{
357333
SOCK_ERRNO;
358334
nbdebug(("socket()#2 in netbeans_connect()\n"));
359335
PERROR("socket()#2 in netbeans_connect()");
360336
goto theend;
361337
}
362-
#else
363-
if ((sd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
364-
{
365-
SOCK_ERRNO;
366-
nbdebug(("socket()#2 in netbeans_connect()\n"));
367-
PERROR("socket()#2 in netbeans_connect()");
368-
goto theend;
369-
}
370-
#endif
371338
if (connect(sd, (struct sockaddr *)&server, sizeof(server)))
372339
{
373340
int retries = 36;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ static char *(features[]) =
741741

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
1174,
744746
/**/
745747
1173,
746748
/**/

0 commit comments

Comments
 (0)