Merge pull request #24575 from taosdata/fix/TD-28356
fix: err in create log should not be ignored
This commit is contained in:
commit
31b8410c33
|
@ -681,8 +681,9 @@ void taos_init_imp(void) {
|
||||||
snprintf(logDirName, 64, "taoslog");
|
snprintf(logDirName, 64, "taoslog");
|
||||||
#endif
|
#endif
|
||||||
if (taosCreateLog(logDirName, 10, configDir, NULL, NULL, NULL, NULL, 1) != 0) {
|
if (taosCreateLog(logDirName, 10, configDir, NULL, NULL, NULL, NULL, 1) != 0) {
|
||||||
// ignore create log failed, only print
|
|
||||||
printf(" WARING: Create %s failed:%s. configDir=%s\n", logDirName, strerror(errno), configDir);
|
printf(" WARING: Create %s failed:%s. configDir=%s\n", logDirName, strerror(errno), configDir);
|
||||||
|
tscInitRes = -1;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (taosInitCfg(configDir, NULL, NULL, NULL, NULL, 1) != 0) {
|
if (taosInitCfg(configDir, NULL, NULL, NULL, NULL, 1) != 0) {
|
||||||
|
@ -750,8 +751,11 @@ int taos_options_imp(TSDB_OPTION option, const char *str) {
|
||||||
tstrncpy(configDir, str, PATH_MAX);
|
tstrncpy(configDir, str, PATH_MAX);
|
||||||
tscInfo("set cfg:%s to %s", configDir, str);
|
tscInfo("set cfg:%s to %s", configDir, str);
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
}
|
||||||
taos_init(); // initialize global config
|
|
||||||
|
// initialize global config
|
||||||
|
if (taos_init() != 0) {
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
SConfig *pCfg = taosGetCfg();
|
SConfig *pCfg = taosGetCfg();
|
||||||
|
|
|
@ -28,7 +28,7 @@ void shellCrashHandler(int signum, void *sigInfo, void *context) {
|
||||||
|
|
||||||
#if !defined(WINDOWS)
|
#if !defined(WINDOWS)
|
||||||
taosIgnSignal(SIGBUS);
|
taosIgnSignal(SIGBUS);
|
||||||
#endif
|
#endif
|
||||||
taosIgnSignal(SIGABRT);
|
taosIgnSignal(SIGABRT);
|
||||||
taosIgnSignal(SIGFPE);
|
taosIgnSignal(SIGFPE);
|
||||||
taosIgnSignal(SIGSEGV);
|
taosIgnSignal(SIGSEGV);
|
||||||
|
@ -82,7 +82,9 @@ int main(int argc, char *argv[]) {
|
||||||
#ifdef WEBSOCKET
|
#ifdef WEBSOCKET
|
||||||
shellCheckConnectMode();
|
shellCheckConnectMode();
|
||||||
#endif
|
#endif
|
||||||
taos_init();
|
if (taos_init() != 0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
// kill heart-beat thread when quit
|
// kill heart-beat thread when quit
|
||||||
taos_set_hb_quit(1);
|
taos_set_hb_quit(1);
|
||||||
|
@ -105,7 +107,7 @@ int main(int argc, char *argv[]) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// support port feature
|
// support port feature
|
||||||
shellAutoInit();
|
shellAutoInit();
|
||||||
int32_t ret = shellExecute();
|
int32_t ret = shellExecute();
|
||||||
shellAutoExit();
|
shellAutoExit();
|
||||||
|
|
Loading…
Reference in New Issue