提交 5444fe6b 编写于 作者: M Minglei Jin

tsVersion: refactor to correct format

上级 afcb1af1
...@@ -161,7 +161,7 @@ extern float tsMinimalLogDirGB; ...@@ -161,7 +161,7 @@ extern float tsMinimalLogDirGB;
extern float tsReservedTmpDirectorySpace; extern float tsReservedTmpDirectorySpace;
extern float tsMinimalDataDirGB; extern float tsMinimalDataDirGB;
extern int32_t tsTotalMemoryMB; extern int32_t tsTotalMemoryMB;
extern int32_t tsVersion; extern uint32_t tsVersion;
// build info // build info
extern char version[]; extern char version[];
......
...@@ -201,7 +201,7 @@ float tsAvailDataDirGB = 0; ...@@ -201,7 +201,7 @@ float tsAvailDataDirGB = 0;
float tsReservedTmpDirectorySpace = 0.1f; float tsReservedTmpDirectorySpace = 0.1f;
float tsMinimalDataDirGB = 0.5f; float tsMinimalDataDirGB = 0.5f;
int32_t tsTotalMemoryMB = 0; int32_t tsTotalMemoryMB = 0;
int32_t tsVersion = 0; uint32_t tsVersion = 0;
// log // log
int32_t tsNumOfLogLines = 10000000; int32_t tsNumOfLogLines = 10000000;
...@@ -1451,15 +1451,20 @@ int32_t taosCheckGlobalCfg() { ...@@ -1451,15 +1451,20 @@ int32_t taosCheckGlobalCfg() {
// todo refactor // todo refactor
tsVersion = 0; tsVersion = 0;
for (int i = 0; i < 10; i++) { for (int ver = 0, i = 0; i < TSDB_VERSION_LEN; ++i) {
if (version[i] >= '0' && version[i] <= '9') { if (version[i] >= '0' && version[i] <= '9') {
tsVersion = tsVersion * 10 + (version[i] - '0'); ver = ver * 10 + (version[i] - '0');
} else if (version[i] == '.') {
tsVersion |= ver & 0xFF;
tsVersion <<= 8;
ver = 0;
} else if (version[i] == 0) { } else if (version[i] == 0) {
tsVersion |= ver & 0xFF;
break; break;
} }
} }
tsVersion = 10 * tsVersion;
tsDnodeShellPort = tsServerPort + TSDB_PORT_DNODESHELL; // udp[6035-6039] tcp[6035] tsDnodeShellPort = tsServerPort + TSDB_PORT_DNODESHELL; // udp[6035-6039] tcp[6035]
tsDnodeDnodePort = tsServerPort + TSDB_PORT_DNODEDNODE; // udp/tcp tsDnodeDnodePort = tsServerPort + TSDB_PORT_DNODEDNODE; // udp/tcp
......
#ifndef _TS_BUILD_H_
#define _TS_BUILD_H_
extern const char tsVersion[];
extern const char tsBuildInfo[];
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册