未验证 提交 f9df4e35 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #3139 from taosdata/hotfix/os

TD-1090
......@@ -68,8 +68,7 @@ ELSEIF (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
MESSAGE(STATUS "The current platform is Windows 64-bit")
ELSE ()
SET(TD_WINDOWS_32 TRUE)
MESSAGE(FATAL_ERROR "The current platform is Windows 32-bit, not supported yet")
EXIT ()
MESSAGE(STATUS "The current platform is Windows 32-bit")
ENDIF ()
ELSE()
MESSAGE(FATAL_ERROR "The current platform is not Linux/Darwin/Windows, stop compile")
......
......@@ -359,12 +359,12 @@ static unsigned char* ensure(printbuffer * const p, size_t needed)
}
/* calculate new buffer size */
if (needed > (LLONG_MAX / 2))
if (needed > (LONG_MAX / 2))
{
/* overflow of int, use LLONG_MAX if possible */
if (needed <= LLONG_MAX)
if (needed <= LONG_MAX)
{
newsize = LLONG_MAX;
newsize = LONG_MAX;
}
else
{
......
......@@ -25,6 +25,7 @@ extern "C" {
#define taosSendto(sockfd, buf, len, flags, dest_addr, addrlen) sendto(sockfd, buf, len, flags, dest_addr, addrlen)
#define taosReadSocket(fd, buf, len) read(fd, buf, len)
#define taosWriteSocket(fd, buf, len) write(fd, buf, len)
#define taosCloseSocketNoCheck(x) close(x)
#define taosCloseSocket(x) \
{ \
if (FD_VALID(x)) { \
......
......@@ -90,6 +90,7 @@ extern "C" {
#define taosSendto(sockfd, buf, len, flags, dest_addr, addrlen) sendto((SOCKET)sockfd, buf, len, flags, dest_addr, addrlen)
#define taosWriteSocket(fd, buf, len) send((SOCKET)fd, buf, len, 0)
#define taosReadSocket(fd, buf, len) recv((SOCKET)fd, buf, len, 0)
#define taosCloseSocketNoCheck(fd) closesocket((SOCKET)fd)
#define taosCloseSocket(fd) closesocket((SOCKET)fd)
typedef SOCKET eventfd_t;
#define eventfd(a, b) -1
......
......@@ -233,7 +233,7 @@ SOCKET taosOpenUdpSocket(uint32_t ip, uint16_t port) {
if ((sockFd = (int)socket(AF_INET, SOCK_DGRAM, 0)) <= 2) {
uError("failed to open udp socket: %d (%s)", errno, strerror(errno));
close(sockFd);
taosCloseSocketNoCheck(sockFd);
return -1;
}
......@@ -268,7 +268,7 @@ SOCKET taosOpenTcpClientSocket(uint32_t destIp, uint16_t destPort, uint32_t clie
if (sockFd <= 2) {
uError("failed to open the socket: %d (%s)", errno, strerror(errno));
close(sockFd);
taosCloseSocketNoCheck(sockFd);
return -1;
}
......@@ -375,7 +375,7 @@ SOCKET taosOpenTcpServerSocket(uint32_t ip, uint16_t port) {
if ((sockFd = (int)socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) <= 2) {
uError("failed to open TCP socket: %d (%s)", errno, strerror(errno));
close(sockFd);
taosCloseSocketNoCheck(sockFd);
return -1;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册