mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-10 14:58:01 +00:00
OSX: fix setsockopt compile bug
This commit is contained in:
parent
f0f6a0046c
commit
0c25ff8416
10
util.c
10
util.c
@ -26,6 +26,7 @@
|
||||
#include <sys/types.h>
|
||||
#ifndef WIN32
|
||||
# include <sys/socket.h>
|
||||
# include <netinet/in.h>
|
||||
# include <netinet/tcp.h>
|
||||
#else
|
||||
# include <winsock2.h>
|
||||
@ -262,6 +263,8 @@ int json_rpc_call_sockopt_cb(void *userdata, curl_socket_t fd, curlsocktype purp
|
||||
if (unlikely(setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &keepalive, sizeof(keepalive))))
|
||||
return 1;
|
||||
|
||||
# ifndef __APPLE_CC__
|
||||
|
||||
if (unlikely(setsockopt(fd, SOL_TCP, TCP_KEEPCNT, &tcp_keepcnt, sizeof(tcp_keepcnt))))
|
||||
return 1;
|
||||
|
||||
@ -271,6 +274,13 @@ int json_rpc_call_sockopt_cb(void *userdata, curl_socket_t fd, curlsocktype purp
|
||||
if (unlikely(setsockopt(fd, SOL_TCP, TCP_KEEPINTVL, &tcp_keepintvl, sizeof(tcp_keepintvl))))
|
||||
return 1;
|
||||
|
||||
# else
|
||||
|
||||
if (unlikely(setsockopt(fd, IPPROTO_TCP, TCP_KEEPALIVE, &tcp_keepintvl, sizeof(tcp_keepintvl))))
|
||||
return 1;
|
||||
|
||||
# endif
|
||||
|
||||
#else
|
||||
|
||||
struct tcp_keepalive vals;
|
||||
|
Loading…
Reference in New Issue
Block a user