Some fixes for macOS

pull/1737/head v5.0.0
Jens Steube 6 years ago
parent dc39deba0f
commit 915da5fee3

@ -31,7 +31,11 @@
#include <arpa/inet.h>
#include <netdb.h>
#include <signal.h>
#if defined (__linux__)
#define SEND_FLAGS MSG_NOSIGNAL
#else
#define SEND_FLAGS 0
#endif
#endif
#include "xxhash.h"

@ -901,9 +901,7 @@ bool brain_client_connect (hc_device_param_t *device_param, const status_ctx_t *
return false;
}
#if defined (_WIN)
#else
#if defined (__linux__)
const int one = 1;
if (setsockopt (brain_link_client_fd, SOL_TCP, TCP_NODELAY, &one, sizeof (one)) == -1)
@ -914,6 +912,8 @@ bool brain_client_connect (hc_device_param_t *device_param, const status_ctx_t *
return false;
}
#else
#endif
struct addrinfo hints;
@ -1990,9 +1990,7 @@ void *brain_server_handle_client (void *p)
// client configuration
#if defined (_WIN)
#else
#if defined (__linux__)
const int one = 1;
if (setsockopt (client_fd, SOL_TCP, TCP_NODELAY, &one, sizeof (one)) == -1)
@ -2003,6 +2001,8 @@ void *brain_server_handle_client (void *p)
return NULL;
}
#else
#endif
u32 brain_link_version;
@ -2919,9 +2919,7 @@ int brain_server (const char *listen_host, const int listen_port, const char *br
return -1;
}
#if defined (_WIN)
#else
#if defined (__linux__)
const int one = 1;
if (setsockopt (server_fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof (one)) == -1)
@ -2937,6 +2935,8 @@ int brain_server (const char *listen_host, const int listen_port, const char *br
return -1;
}
#else
#endif
struct sockaddr_in sa;

Loading…
Cancel
Save