提交 6f5ee32d 编写于 作者: H Hongze Cheng

Merge branch 'feature/linux' into feature/TD-1925_new

...@@ -89,11 +89,12 @@ pid_t getppid(void); /* Get parent PID */ ...@@ -89,11 +89,12 @@ pid_t getppid(void); /* Get parent PID */
/* Path management */ /* Path management */
#if defined(_WIN32) #if defined(_WIN32)
#if defined(_UTF8_SOURCE) || defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
#define realpath realpathU #define realpath realpathU
#if defined(_UTF8_SOURCE) || defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
// #define realpath realpathU
#define CompactPath CompactPathU #define CompactPath CompactPathU
#else /* _ANSI_SOURCE */ #else /* _ANSI_SOURCE */
#define realpath realpathA // #define realpath realpathA
#define CompactPath CompactPathA #define CompactPath CompactPathA
#endif #endif
#endif /* defined(_WIN32) */ #endif /* defined(_WIN32) */
......
...@@ -59,7 +59,6 @@ char tsLocale[TSDB_LOCALE_LEN] = {0}; ...@@ -59,7 +59,6 @@ char tsLocale[TSDB_LOCALE_LEN] = {0};
char tsCharset[TSDB_LOCALE_LEN] = {0}; // default encode string char tsCharset[TSDB_LOCALE_LEN] = {0}; // default encode string
int8_t tsEnableCoreFile = 0; int8_t tsEnableCoreFile = 0;
int32_t tsMaxBinaryDisplayWidth = 30; int32_t tsMaxBinaryDisplayWidth = 30;
char tsTempDir[TSDB_FILENAME_LEN] = "/tmp/";
/* /*
* denote if the server needs to compress response message at the application layer to client, including query rsp, * denote if the server needs to compress response message at the application layer to client, including query rsp,
...@@ -182,6 +181,7 @@ char tsDnodeDir[TSDB_FILENAME_LEN] = {0}; ...@@ -182,6 +181,7 @@ char tsDnodeDir[TSDB_FILENAME_LEN] = {0};
char tsMnodeDir[TSDB_FILENAME_LEN] = {0}; char tsMnodeDir[TSDB_FILENAME_LEN] = {0};
char tsDataDir[TSDB_FILENAME_LEN] = {0}; char tsDataDir[TSDB_FILENAME_LEN] = {0};
char tsScriptDir[TSDB_FILENAME_LEN] = {0}; char tsScriptDir[TSDB_FILENAME_LEN] = {0};
char tsTempDir[TSDB_FILENAME_LEN] = "/tmp/";
int32_t tsDiskCfgNum = 0; int32_t tsDiskCfgNum = 0;
......
...@@ -26,10 +26,6 @@ extern "C" { ...@@ -26,10 +26,6 @@ extern "C" {
#endif #endif
#endif #endif
#ifndef STDERR_FILENO
#define STDERR_FILENO (2)
#endif
#define FD_VALID(x) ((x) > STDERR_FILENO) #define FD_VALID(x) ((x) > STDERR_FILENO)
#define FD_INITIALIZER ((int32_t)-1) #define FD_INITIALIZER ((int32_t)-1)
......
...@@ -46,6 +46,8 @@ ...@@ -46,6 +46,8 @@
#include "msvcFcntl.h" #include "msvcFcntl.h"
#include "msvcLibgen.h" #include "msvcLibgen.h"
#include "msvcStdio.h" #include "msvcStdio.h"
#include "msvcUnistd.h"
#include "msvcLibgen.h"
#include "sys/msvcStat.h" #include "sys/msvcStat.h"
#include "sys/msvcTypes.h" #include "sys/msvcTypes.h"
...@@ -144,7 +146,6 @@ typedef int (*__compar_fn_t)(const void *, const void *); ...@@ -144,7 +146,6 @@ typedef int (*__compar_fn_t)(const void *, const void *);
#define in_addr_t unsigned long #define in_addr_t unsigned long
#define socklen_t int #define socklen_t int
#define htobe64 htonll #define htobe64 htonll
#define getpid _getpid
struct tm *localtime_r(const time_t *timep, struct tm *result); struct tm *localtime_r(const time_t *timep, struct tm *result);
char * strptime(const char *buf, const char *fmt, struct tm *tm); char * strptime(const char *buf, const char *fmt, struct tm *tm);
...@@ -153,15 +154,8 @@ char * getpass(const char *prefix); ...@@ -153,15 +154,8 @@ char * getpass(const char *prefix);
int flock(int fd, int option); int flock(int fd, int option);
int fsync(int filedes); int fsync(int filedes);
char * strndup(const char *s, size_t n); char * strndup(const char *s, size_t n);
char * dirname(char *pszPathname);
int gettimeofday(struct timeval *ptv, void *pTimeZone); int gettimeofday(struct timeval *ptv, void *pTimeZone);
// for access function in io.h
#define F_OK 00 //Existence only
#define W_OK 02 //Write - only
#define R_OK 04 //Read - only
#define X_OK 06 //Read and write
// for send function in tsocket.c // for send function in tsocket.c
#define MSG_NOSIGNAL 0 #define MSG_NOSIGNAL 0
#define SO_NO_CHECK 0x1234 #define SO_NO_CHECK 0x1234
...@@ -208,8 +202,6 @@ typedef struct { ...@@ -208,8 +202,6 @@ typedef struct {
int wordexp(char *words, wordexp_t *pwordexp, int flags); int wordexp(char *words, wordexp_t *pwordexp, int flags);
void wordfree(wordexp_t *pwordexp); void wordfree(wordexp_t *pwordexp);
char *realpath(char *path, char *resolved_path);
#define openlog(a, b, c) #define openlog(a, b, c)
#define closelog() #define closelog()
#define LOG_ERR 0 #define LOG_ERR 0
......
...@@ -75,18 +75,6 @@ char *getpass(const char *prefix) { ...@@ -75,18 +75,6 @@ char *getpass(const char *prefix) {
return passwd; return passwd;
} }
char *strndup(const char *s, size_t n) {
size_t len = strlen(s);
if (len >= n) {
len = n;
}
char *r = calloc(len + 1, 1);
memcpy(r, s, len);
r[len] = 0;
return r;
}
int twcslen(const wchar_t *wcs) { int twcslen(const wchar_t *wcs) {
int *wstr = (int *)wcs; int *wstr = (int *)wcs;
if (NULL == wstr) { if (NULL == wstr) {
......
...@@ -38,7 +38,3 @@ int wordexp(char *words, wordexp_t *pwordexp, int flags) { ...@@ -38,7 +38,3 @@ int wordexp(char *words, wordexp_t *pwordexp, int flags) {
} }
void wordfree(wordexp_t *pwordexp) {} void wordfree(wordexp_t *pwordexp) {}
char *realpath(char *path, char *resolved_path) {
return _fullpath(path, resolved_path, TSDB_FILENAME_LEN - 1);
}
\ No newline at end of file
...@@ -593,7 +593,7 @@ void taosGetDisk() { ...@@ -593,7 +593,7 @@ void taosGetDisk() {
tsAvailLogDirGB = (float)(diskSize.avail / unit); tsAvailLogDirGB = (float)(diskSize.avail / unit);
} }
if (taosGetDiskSize("/tmp", &diskSize) == 0) { if (taosGetDiskSize(tsTempDir, &diskSize) == 0) {
tsTotalTmpDirGB = (float)(diskSize.tsize / unit); tsTotalTmpDirGB = (float)(diskSize.tsize / unit);
tsAvailTmpDirectorySpace = (float)(diskSize.avail / unit); tsAvailTmpDirectorySpace = (float)(diskSize.avail / unit);
} }
......
...@@ -134,6 +134,11 @@ static bool taosReadDirectoryConfig(SGlobalCfg *cfg, char *input_value) { ...@@ -134,6 +134,11 @@ static bool taosReadDirectoryConfig(SGlobalCfg *cfg, char *input_value) {
wordfree(&full_path); wordfree(&full_path);
char tmp[1025] = {0};
if (realpath(option, tmp) != NULL) {
strcpy(option, tmp);
}
int code = taosMkDir(option, 0755); int code = taosMkDir(option, 0755);
if (code != 0) { if (code != 0) {
terrno = TAOS_SYSTEM_ERROR(errno); terrno = TAOS_SYSTEM_ERROR(errno);
......
...@@ -44,10 +44,10 @@ echo serverPort 7100 >> %TAOS_CFG% ...@@ -44,10 +44,10 @@ echo serverPort 7100 >> %TAOS_CFG%
echo logDir %LOG_DIR% >> %TAOS_CFG% echo logDir %LOG_DIR% >> %TAOS_CFG%
echo scriptDir %SCRIPT_DIR% >> %TAOS_CFG% echo scriptDir %SCRIPT_DIR% >> %TAOS_CFG%
echo numOfLogLines 100000000 >> %TAOS_CFG% echo numOfLogLines 100000000 >> %TAOS_CFG%
echo rpcDebugFlag 143 >> %TAOS_CFG% echo rpcDebugFlag 135 >> %TAOS_CFG%
echo tmrDebugFlag 131 >> %TAOS_CFG% echo tmrDebugFlag 131 >> %TAOS_CFG%
echo cDebugFlag 143 >> %TAOS_CFG% echo cDebugFlag 135 >> %TAOS_CFG%
echo udebugFlag 143 >> %TAOS_CFG% echo udebugFlag 135 >> %TAOS_CFG%
echo wal 0 >> %TAOS_CFG% echo wal 0 >> %TAOS_CFG%
echo asyncLog 0 >> %TAOS_CFG% echo asyncLog 0 >> %TAOS_CFG%
echo locale en_US.UTF-8 >> %TAOS_CFG% echo locale en_US.UTF-8 >> %TAOS_CFG%
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册