提交 53f77b41 编写于 作者: G Ganlin Zhao

fix windows compilation error

上级 e51050bf
...@@ -71,9 +71,13 @@ int32_t taosSetSockOpt(SOCKET socketfd, int32_t level, int32_t optname, void *op ...@@ -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); 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) { 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); return getsockopt(socketfd, level, optname, optval, (socklen_t *)optlen);
} }
#endif #endif
......
...@@ -386,7 +386,7 @@ SOCKET taosOpenTcpClientSocket(uint32_t destIp, uint16_t destPort, uint32_t clie ...@@ -386,7 +386,7 @@ SOCKET taosOpenTcpClientSocket(uint32_t destIp, uint16_t destPort, uint32_t clie
} }
} }
taosSetNonblocking(sockFd, 0); 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); taosSetNonblocking(sockFd, 1);
ret = connect(sockFd, (struct sockaddr *)&serverAddr, sizeof(serverAddr)); ret = connect(sockFd, (struct sockaddr *)&serverAddr, sizeof(serverAddr));
...@@ -396,7 +396,7 @@ SOCKET taosOpenTcpClientSocket(uint32_t destIp, uint16_t destPort, uint32_t clie ...@@ -396,7 +396,7 @@ SOCKET taosOpenTcpClientSocket(uint32_t destIp, uint16_t destPort, uint32_t clie
taosCloseSocket(sockFd); taosCloseSocket(sockFd);
return -1; return -1;
} else if (errno == EINPROGRESS || errno == EAGAIN || errno == EWOULDBLOCK) { } else if (errno == EINPROGRESS || errno == EAGAIN || errno == EWOULDBLOCK) {
timeval timeout; struct timeval timeout;
fd_set set; fd_set set;
timeout.tv_sec = 0; timeout.tv_sec = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册