[TD_543] fix coverity scan, cid:267787
This commit is contained in:
parent
422e45bd25
commit
628bb01969
|
@ -301,7 +301,9 @@ void tscSaveSubscriptionProgress(void* sub) {
|
||||||
char path[256];
|
char path[256];
|
||||||
sprintf(path, "%s/subscribe", tsDataDir);
|
sprintf(path, "%s/subscribe", tsDataDir);
|
||||||
if (access(path, 0) != 0) {
|
if (access(path, 0) != 0) {
|
||||||
mkdir(path, 0777);
|
if (mkdir(path, 0777) != 0 && errno != EEXIST) {
|
||||||
|
tscError("failed to create subscribe dir: %s", path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(path, "%s/subscribe/%s", tsDataDir, pSub->topic);
|
sprintf(path, "%s/subscribe/%s", tsDataDir, pSub->topic);
|
||||||
|
|
|
@ -80,9 +80,8 @@ int32_t tscInitRpc(const char *user, const char *secret, void** pDnodeConn) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void taos_init_imp() {
|
void taos_init_imp() {
|
||||||
char temp[128];
|
char temp[128];
|
||||||
struct stat dirstat;
|
|
||||||
|
|
||||||
errno = TSDB_CODE_SUCCESS;
|
errno = TSDB_CODE_SUCCESS;
|
||||||
srand(taosGetTimestampSec());
|
srand(taosGetTimestampSec());
|
||||||
deltaToUtcInitOnce();
|
deltaToUtcInitOnce();
|
||||||
|
@ -94,7 +93,9 @@ void taos_init_imp() {
|
||||||
taosReadGlobalLogCfg();
|
taosReadGlobalLogCfg();
|
||||||
|
|
||||||
// For log directory
|
// For log directory
|
||||||
if (stat(tsLogDir, &dirstat) < 0) mkdir(tsLogDir, 0755);
|
if (mkdir(tsLogDir, 0755) != 0 && errno != EEXIST) {
|
||||||
|
printf("failed to create log dir:%s\n", tsLogDir);
|
||||||
|
}
|
||||||
|
|
||||||
sprintf(temp, "%s/taoslog", tsLogDir);
|
sprintf(temp, "%s/taoslog", tsLogDir);
|
||||||
if (taosInitLog(temp, tsNumOfLogLines, 10) < 0) {
|
if (taosInitLog(temp, tsNumOfLogLines, 10) < 0) {
|
||||||
|
|
Loading…
Reference in New Issue