diff --git a/src/os/inc/osDarwin.h b/src/os/inc/osDarwin.h index 14b8ccf53c5ca2c857a47c007a8ba5933e06ddc6..2a05d5682e7de5c05beab9fd3f3b124ea85de20c 100644 --- a/src/os/inc/osDarwin.h +++ b/src/os/inc/osDarwin.h @@ -105,6 +105,8 @@ typedef int(*__compar_fn_t)(const void *, const void *); #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE #endif +#define TAOS_OS_FUNC_PTHREAD_RWLOCK + int64_t tsosStr2int64(char *str); #include "eok.h" diff --git a/src/os/inc/osSemphone.h b/src/os/inc/osSemphone.h index 74e1bd487815942651111a2aa85e31650281bf20..7c64aa80e5e21dfad42ff48e3841167ac24f9482 100644 --- a/src/os/inc/osSemphone.h +++ b/src/os/inc/osSemphone.h @@ -28,6 +28,14 @@ extern "C" { #define tsem_destroy sem_destroy #endif +#ifdef TAOS_OS_FUNC_PTHREAD_RWLOCK + #define pthread_rwlock_t pthread_mutex_t + #define pthread_rwlock_init(lock) pthread_mutex_init(lock) + #define pthread_mutex_destroy(lock) pthread_mutex_destroy(lock) + #define pthread_rwlock_wrlock(lock) pthread_mutex_lock(lock) + #define pthread_rwlock_unlock(lock) pthread_mutex_unlock(lock) +#endif + // TAOS_OS_FUNC_SEMPHONE_PTHREAD bool taosCheckPthreadValid(pthread_t thread); int64_t taosGetSelfPthreadId(); diff --git a/src/os/src/windows/wWordexp.c b/src/os/src/windows/wWordexp.c index fca283cb339d6cdb48f789bf20de1c69b724f10f..929505516dede880e0354dbed63919198ae9e5d1 100644 --- a/src/os/src/windows/wWordexp.c +++ b/src/os/src/windows/wWordexp.c @@ -27,7 +27,7 @@ int wordexp(char *words, wordexp_t *pwordexp, int flags) { pwordexp->we_wordv[0] = pwordexp->wordPos; memset(pwordexp->wordPos, 0, 1025); - if (_fullpath(words, pwordexp->wordPos, 1024) == NULL) { + if (_fullpath(pwordexp->wordPos, words, 1024) == NULL) { pwordexp->we_wordv[0] = words; uError("failed to parse relative path:%s to abs path", words); return -1; diff --git a/src/tsdb/src/tsdbCommit.c b/src/tsdb/src/tsdbCommit.c index ec9ea4fa15d00402d13b723232b25f83622254d6..3216b18459bb8a7028c54ff5cf7f17be81c2e154 100644 --- a/src/tsdb/src/tsdbCommit.c +++ b/src/tsdb/src/tsdbCommit.c @@ -280,10 +280,12 @@ static int tsdbDropMetaRecord(STsdbFS *pfs, SMFile *pMFile, uint64_t uid) { // =================== Commit Time-Series Data static int tsdbCommitTSData(STsdbRepo *pRepo) { SMemTable *pMem = pRepo->imem; - SCommitH commith = {0}; + SCommitH commith; SDFileSet *pSet = NULL; int fid; + memset(&commith, 0, sizeof(SMemTable *)); + if (pMem->numOfRows <= 0) { // No memory data, just apply retention on each file on disk if (tsdbApplyRtn(pRepo) < 0) { diff --git a/src/util/src/ttimer.c b/src/util/src/ttimer.c index 6029edf5120314cf13405f69fb8e120e73d61183..809b69e8ad73fd06af18a2a52593a3913d603491 100644 --- a/src/util/src/ttimer.c +++ b/src/util/src/ttimer.c @@ -188,7 +188,11 @@ static void removeTimer(uintptr_t id) { } static int64_t getMonotonicMs(void) { +#ifdef WINDOWS return (int64_t) getMonotonicUs() / 1000; +#else + return taosGetTimestampMs(); +#endif } static void addToWheel(tmr_obj_t* timer, uint32_t delay) { @@ -537,7 +541,8 @@ static void taosTmrModuleInit(void) { } void* taosTmrInit(int maxNumOfTmrs, int resolution, int longest, const char* label) { - tmrInfo("ttimer monotonic clock source:%s", monotonicInit()); + const char* ret = monotonicInit(); + tmrInfo("ttimer monotonic clock source:%s", ret); pthread_once(&tmrModuleInit, taosTmrModuleInit);