diff --git a/src/os/src/detail/osSocket.c b/src/os/src/detail/osSocket.c index 7ce9d6eb06621f0a691699020cff13b9c15a9a88..0b6cda29b4a53d8e6893513a4b8a478e37eb2e39 100644 --- a/src/os/src/detail/osSocket.c +++ b/src/os/src/detail/osSocket.c @@ -71,9 +71,13 @@ int32_t taosSetSockOpt(SOCKET socketfd, int32_t level, int32_t optname, void *op return setsockopt(socketfd, level, optname, optval, (socklen_t)optlen); } +#endif + +#if !defined(_TD_DARWIN_32) + int32_t taosGetSockOpt(SOCKET socketfd, int32_t level, int32_t optname, void *optval, int32_t* optlen) { return getsockopt(socketfd, level, optname, optval, (socklen_t *)optlen); -} +} #endif diff --git a/src/util/src/tsocket.c b/src/util/src/tsocket.c index 43812bd71377727e1ae35e36869a9dbe9855fbf9..636dff145ccc3531d5d35cf2f8b49493d3067c20 100644 --- a/src/util/src/tsocket.c +++ b/src/util/src/tsocket.c @@ -386,7 +386,7 @@ SOCKET taosOpenTcpClientSocket(uint32_t destIp, uint16_t destPort, uint32_t clie } } taosSetNonblocking(sockFd, 0); -#elif defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32) || defined(_TD_WINDOWS) +#elif defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32) taosSetNonblocking(sockFd, 1); ret = connect(sockFd, (struct sockaddr *)&serverAddr, sizeof(serverAddr)); @@ -396,7 +396,7 @@ SOCKET taosOpenTcpClientSocket(uint32_t destIp, uint16_t destPort, uint32_t clie taosCloseSocket(sockFd); return -1; } else if (errno == EINPROGRESS || errno == EAGAIN || errno == EWOULDBLOCK) { - timeval timeout; + struct timeval timeout; fd_set set; timeout.tv_sec = 0;