Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 54e8b65

Browse files
committed
include netinet/tcp.h on all non-windows platforms and fix TCP_NODELAY=false build
1 parent b7fe913 commit 54e8b65

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

contrib/mmts/arbiter.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,15 @@
99
#ifdef WIN32
1010
#include <winsock2.h>
1111
#include <ws2tcpip.h>
12+
#else
13+
#include <netinet/tcp.h>
1214
#endif
1315

1416
#include <unistd.h>
1517
#include <sys/time.h>
1618
#include <sys/types.h>
1719
#include <sys/socket.h>
1820
#include <netinet/in.h>
19-
#ifdef HAVE_NETINET_TCP_H
20-
#include <netinet/tcp.h>
21-
#endif
2221
#include <arpa/inet.h>
2322
#include <errno.h>
2423
#include <netdb.h>
@@ -276,8 +275,8 @@ static int MtmReadSocket(int sd, void* buf, int buf_size)
276275

277276
static void MtmSetSocketOptions(int sd)
278277
{
279-
#ifdef TCP_NODELAY
280278
int on = 1;
279+
#ifdef TCP_NODELAY
281280
if (pg_setsockopt(sd, IPPROTO_TCP, TCP_NODELAY, (char const*)&on, sizeof(on), MtmUseRDMA) < 0) {
282281
MTM_ELOG(WARNING, "Failed to set TCP_NODELAY: %m");
283282
}

0 commit comments

Comments
 (0)