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

Merge pull request #3147 from taosdata/hotfix/mergemaster

Master
......@@ -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
{
......
......@@ -50,7 +50,7 @@ typedef struct {
static const SDnodeComponent tsDnodeComponents[] = {
{"storage", dnodeInitStorage, dnodeCleanupStorage},
{"check", dnodeInitCheck, dnodeCleanupCheck}, // NOTES: dnodeInitCheck must be behind the dnodeInitStorage component !!!
{"check", dnodeInitCheck, dnodeCleanupCheck}, // NOTES: dnodeInitCheck must be behind the dnodeinitStorage component !!!
{"vread", dnodeInitVnodeRead, dnodeCleanupVnodeRead},
{"vwrite", dnodeInitVnodeWrite, dnodeCleanupVnodeWrite},
{"mread", dnodeInitMnodeRead, dnodeCleanupMnodeRead},
......
......@@ -636,6 +636,7 @@ static int32_t mnodeRetrieveDbs(SShowObj *pShow, char *data, int32_t rows, void
while (numOfRows < rows) {
pShow->pIter = mnodeGetNextDb(pShow->pIter, &pDb);
if (pDb == NULL) break;
if (pDb->pAcct != pUser->pAcct) continue;
cols = 0;
......@@ -687,8 +688,8 @@ static int32_t mnodeRetrieveDbs(SShowObj *pShow, char *data, int32_t rows, void
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
char tmp[128] = {0};
size_t n = sprintf(tmp, "%d,%d,%d", pDb->cfg.daysToKeep1, pDb->cfg.daysToKeep2, pDb->cfg.daysToKeep);
STR_WITH_SIZE_TO_VARSTR(pWrite, tmp, n);
sprintf(tmp, "%d,%d,%d", pDb->cfg.daysToKeep1, pDb->cfg.daysToKeep2, pDb->cfg.daysToKeep);
STR_WITH_SIZE_TO_VARSTR(pWrite, tmp, strlen(tmp));
cols++;
#ifndef __CLOUD_VERSION__
......
......@@ -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
......
......@@ -547,12 +547,12 @@ int taosSystem(const char *cmd) {
int res;
char buf[1024];
if (cmd == NULL) {
uError("taosSystem cmd is NULL!\n");
uError("taosSystem cmd is NULL!");
return -1;
}
if ((fp = popen(cmd, "r")) == NULL) {
uError("popen cmd:%s error: %s/n", cmd, strerror(errno));
uError("popen cmd:%s error: %s", cmd, strerror(errno));
return -1;
} else {
while (fgets(buf, sizeof(buf), fp)) {
......@@ -560,9 +560,9 @@ int taosSystem(const char *cmd) {
}
if ((res = pclose(fp)) == -1) {
uError("close popen file pointer fp error!\n");
uError("close popen file pointer fp error!");
} else {
uDebug("popen res is :%d\n", res);
uDebug("popen res is :%d", res);
}
return res;
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册