fix: complie error
This commit is contained in:
parent
d5126d469a
commit
6ef608f7af
|
@ -19,7 +19,7 @@ SyncAppendEntriesReply *createMsg() {
|
|||
pMsg->success = true;
|
||||
pMsg->matchIndex = 77;
|
||||
pMsg->term = 33;
|
||||
pMsg->privateTerm = 44;
|
||||
// pMsg->privateTerm = 44;
|
||||
pMsg->startTime = taosGetTimestampMs();
|
||||
return pMsg;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "syncTest.h"
|
||||
#include <gtest/gtest.h>
|
||||
// #include <gtest/gtest.h>
|
||||
|
||||
/*
|
||||
typedef enum {
|
||||
|
|
|
@ -81,6 +81,8 @@ int32_t syncIOQTimerStop();
|
|||
int32_t syncIOPingTimerStart();
|
||||
int32_t syncIOPingTimerStop();
|
||||
|
||||
void syncEntryDestory(SSyncRaftEntry* pEntry);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -469,3 +469,5 @@ static void syncIOTickPing(void *param, void *tmrId) {
|
|||
|
||||
taosTmrReset(syncIOTickPing, io->pingTimerMS, io, io->timerMgr, &io->pingTimer);
|
||||
}
|
||||
|
||||
void syncEntryDestory(SSyncRaftEntry* pEntry) {}
|
|
@ -1583,8 +1583,8 @@ cJSON* syncAppendEntriesReply2Json(const SyncAppendEntriesReply* pMsg) {
|
|||
cJSON_AddNumberToObject(pDestId, "vgId", pMsg->destId.vgId);
|
||||
cJSON_AddItemToObject(pRoot, "destId", pDestId);
|
||||
|
||||
snprintf(u64buf, sizeof(u64buf), "%" PRIu64, pMsg->privateTerm);
|
||||
cJSON_AddStringToObject(pRoot, "privateTerm", u64buf);
|
||||
// snprintf(u64buf, sizeof(u64buf), "%" PRIu64, pMsg->privateTerm);
|
||||
// cJSON_AddStringToObject(pRoot, "privateTerm", u64buf);
|
||||
|
||||
snprintf(u64buf, sizeof(u64buf), "%" PRIu64, pMsg->term);
|
||||
cJSON_AddStringToObject(pRoot, "term", u64buf);
|
||||
|
|
|
@ -163,7 +163,7 @@ int32_t taosMulMkDir(const char *dirname) {
|
|||
code = mkdir(temp, 0755);
|
||||
#endif
|
||||
if (code < 0 && errno != EEXIST) {
|
||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||
// terrno = TAOS_SYSTEM_ERROR(errno);
|
||||
return code;
|
||||
}
|
||||
*pos = TD_DIRSEP[0];
|
||||
|
@ -179,7 +179,7 @@ int32_t taosMulMkDir(const char *dirname) {
|
|||
code = mkdir(temp, 0755);
|
||||
#endif
|
||||
if (code < 0 && errno != EEXIST) {
|
||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||
// terrno = TAOS_SYSTEM_ERROR(errno);
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
@ -225,7 +225,7 @@ int32_t taosMulModeMkDir(const char *dirname, int mode) {
|
|||
code = mkdir(temp, mode);
|
||||
#endif
|
||||
if (code < 0 && errno != EEXIST) {
|
||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||
// terrno = TAOS_SYSTEM_ERROR(errno);
|
||||
return code;
|
||||
}
|
||||
*pos = TD_DIRSEP[0];
|
||||
|
@ -241,7 +241,7 @@ int32_t taosMulModeMkDir(const char *dirname, int mode) {
|
|||
code = mkdir(temp, mode);
|
||||
#endif
|
||||
if (code < 0 && errno != EEXIST) {
|
||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||
// terrno = TAOS_SYSTEM_ERROR(errno);
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -313,7 +313,7 @@ TdFilePtr taosOpenFile(const char *path, int32_t tdFileOptions) {
|
|||
assert(!(tdFileOptions & TD_FILE_EXCL));
|
||||
fp = fopen(path, mode);
|
||||
if (fp == NULL) {
|
||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||
// terrno = TAOS_SYSTEM_ERROR(errno);
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
|
@ -336,14 +336,14 @@ TdFilePtr taosOpenFile(const char *path, int32_t tdFileOptions) {
|
|||
fd = open(path, access, S_IRWXU | S_IRWXG | S_IRWXO);
|
||||
#endif
|
||||
if (fd == -1) {
|
||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||
// terrno = TAOS_SYSTEM_ERROR(errno);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
TdFilePtr pFile = (TdFilePtr)taosMemoryMalloc(sizeof(TdFile));
|
||||
if (pFile == NULL) {
|
||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||
// terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||
if (fd >= 0) close(fd);
|
||||
if (fp != NULL) fclose(fp);
|
||||
return NULL;
|
||||
|
|
|
@ -348,7 +348,7 @@ void taosMemoryTrim(int32_t size) {
|
|||
|
||||
void* taosMemoryMallocAlign(uint32_t alignment, int64_t size) {
|
||||
#ifdef USE_TD_MEMORY
|
||||
tAssert(0);
|
||||
assert(0);
|
||||
#else
|
||||
#if defined(LINUX)
|
||||
void* p = memalign(alignment, size);
|
||||
|
|
|
@ -617,14 +617,14 @@ int32_t taosGetDiskSize(char *dataDir, SDiskSize *diskSize) {
|
|||
return 0;
|
||||
} else {
|
||||
// printf("failed to get disk size, dataDir:%s errno:%s", tsDataDir, strerror(errno));
|
||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||
// terrno = TAOS_SYSTEM_ERROR(errno);
|
||||
return -1;
|
||||
}
|
||||
#elif defined(_TD_DARWIN_64)
|
||||
struct statvfs info;
|
||||
if (statvfs(dataDir, &info)) {
|
||||
// printf("failed to get disk size, dataDir:%s errno:%s", tsDataDir, strerror(errno));
|
||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||
// terrno = TAOS_SYSTEM_ERROR(errno);
|
||||
return -1;
|
||||
} else {
|
||||
diskSize->total = info.f_blocks * info.f_frsize;
|
||||
|
@ -635,7 +635,7 @@ int32_t taosGetDiskSize(char *dataDir, SDiskSize *diskSize) {
|
|||
#else
|
||||
struct statvfs info;
|
||||
if (statvfs(dataDir, &info)) {
|
||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||
// terrno = TAOS_SYSTEM_ERROR(errno);
|
||||
return -1;
|
||||
} else {
|
||||
diskSize->total = info.f_blocks * info.f_frsize;
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include "taos.h"
|
||||
#include "taosdef.h"
|
||||
#include "thash.h"
|
||||
#include "tlog.h"
|
||||
|
||||
namespace {
|
||||
|
||||
|
|
Loading…
Reference in New Issue