Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
362fb3d3
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
362fb3d3
编写于
8月 03, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1037 os module compile
上级
6fd3fc34
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
36 addition
and
20 deletion
+36
-20
deps/CMakeLists.txt
deps/CMakeLists.txt
+4
-1
deps/iconv/CMakeLists.txt
deps/iconv/CMakeLists.txt
+2
-0
deps/iconv/iconv.h
deps/iconv/iconv.h
+1
-1
deps/lz4/CMakeLists.txt
deps/lz4/CMakeLists.txt
+2
-0
deps/pthread/pthread_mutex_consistent.c
deps/pthread/pthread_mutex_consistent.c
+1
-1
src/os/inc/osDarwin.h
src/os/inc/osDarwin.h
+2
-2
src/os/inc/osLinux32.h
src/os/inc/osLinux32.h
+2
-2
src/os/inc/osWindows.h
src/os/inc/osWindows.h
+2
-2
src/os/src/darwin/darwinSysInfo.c
src/os/src/darwin/darwinSysInfo.c
+1
-1
src/os/src/detail/CMakeLists.txt
src/os/src/detail/CMakeLists.txt
+6
-0
src/os/src/detail/osFile.c
src/os/src/detail/osFile.c
+3
-3
src/os/src/detail/osRand.c
src/os/src/detail/osRand.c
+2
-2
src/os/src/detail/osTime.c
src/os/src/detail/osTime.c
+3
-2
src/os/src/windows/w64File.c
src/os/src/windows/w64File.c
+1
-0
src/os/src/windows/w64Socket.c
src/os/src/windows/w64Socket.c
+2
-1
src/os/src/windows/w64String.c
src/os/src/windows/w64String.c
+1
-1
src/os/src/windows/w64Sysinfo.c
src/os/src/windows/w64Sysinfo.c
+1
-1
未找到文件。
deps/CMakeLists.txt
浏览文件 @
362fb3d3
...
...
@@ -7,4 +7,7 @@ ADD_SUBDIRECTORY(regex)
ADD_SUBDIRECTORY
(
iconv
)
ADD_SUBDIRECTORY
(
lz4
)
ADD_SUBDIRECTORY
(
cJson
)
ADD_SUBDIRECTORY
(
MQTT-C
)
IF
(
NOT TD_WINDOWS
)
ADD_SUBDIRECTORY
(
MQTT-C
)
ENDIF
()
\ No newline at end of file
deps/iconv/CMakeLists.txt
浏览文件 @
362fb3d3
...
...
@@ -5,5 +5,7 @@ IF (TD_WINDOWS_64)
LIST
(
APPEND SRC iconv.c
)
LIST
(
APPEND SRC localcharset.c
)
INCLUDE_DIRECTORIES
(
.
)
SET
(
CMAKE_C_FLAGS_DEBUG
"
${
CMAKE_C_FLAGS_DEBUG
}
/WX-"
)
SET
(
CMAKE_C_FLAGS_RELEASE
"
${
CMAKE_C_FLAGS_RELEASE
}
/WX-"
)
ADD_LIBRARY
(
iconv
${
SRC
}
)
ENDIF
()
\ No newline at end of file
deps/iconv/iconv.h
浏览文件 @
362fb3d3
/* Copyright (C) 1999-2003, 2005-2006, 2008-2009 Free Software Foundation, Inc.
/* Copyright (C) 1999-2003, 2005-2006, 2008-2009 Free Software Foundation, Inc.
This file is part of the GNU LIBICONV Library.
The GNU LIBICONV Library is free software; you can redistribute it
...
...
deps/lz4/CMakeLists.txt
浏览文件 @
362fb3d3
aux_source_directory
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/src SOURCE_LIST
)
add_library
(
lz4
${
SOURCE_LIST
}
)
SET
(
CMAKE_C_FLAGS_DEBUG
"
${
CMAKE_C_FLAGS_DEBUG
}
/WX-"
)
SET
(
CMAKE_C_FLAGS_RELEASE
"
${
CMAKE_C_FLAGS_RELEASE
}
/WX-"
)
target_include_directories
(
lz4 PUBLIC
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc
)
\ No newline at end of file
deps/pthread/pthread_mutex_consistent.c
浏览文件 @
362fb3d3
/*
/*
* pthread_mutex_consistent.c
*
* Description:
...
...
src/os/inc/osDarwin.h
浏览文件 @
362fb3d3
...
...
@@ -13,8 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TDENGINE_
PLATFORM_LINUX
_H
#define TDENGINE_
PLATFORM_LINUX
_H
#ifndef TDENGINE_
OS_DARWIN
_H
#define TDENGINE_
OS_DARWIN
_H
#ifdef __cplusplus
extern
"C"
{
...
...
src/os/inc/osLinux32.h
浏览文件 @
362fb3d3
...
...
@@ -13,8 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TDENGINE_OS_LINUX
64
_H
#define TDENGINE_OS_LINUX
64
_H
#ifndef TDENGINE_OS_LINUX
32
_H
#define TDENGINE_OS_LINUX
32
_H
#ifdef __cplusplus
extern
"C"
{
...
...
src/os/inc/osWindows.h
浏览文件 @
362fb3d3
...
...
@@ -13,8 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TDENGINE_
PLATFORM
_WINDOWS_H
#define TDENGINE_
PLATFORM
_WINDOWS_H
#ifndef TDENGINE_
OS
_WINDOWS_H
#define TDENGINE_
OS
_WINDOWS_H
#include <assert.h>
#include <ctype.h>
...
...
src/os/src/darwin/darwinSysInfo.c
浏览文件 @
362fb3d3
...
...
@@ -41,7 +41,7 @@ static void taosGetSystemLocale() {
if
(
cfg_locale
&&
cfg_locale
->
cfgStatus
<
TAOS_CFG_CSTATUS_DEFAULT
)
{
char
*
locale
=
setlocale
(
LC_CTYPE
,
"chs"
);
if
(
locale
!=
NULL
)
{
strncpy
(
tsLocale
,
locale
,
TSDB_LOCALE_LEN
-
1
);
tstrncpy
(
tsLocale
,
locale
,
TSDB_LOCALE_LEN
);
cfg_locale
->
cfgStatus
=
TAOS_CFG_CSTATUS_DEFAULT
;
uInfo
(
"locale not configured, set to default:%s"
,
tsLocale
);
}
...
...
src/os/src/detail/CMakeLists.txt
浏览文件 @
362fb3d3
CMAKE_MINIMUM_REQUIRED
(
VERSION 2.8
)
PROJECT
(
TDengine
)
IF
(
TD_WINDOWS
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/deps/pthread
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/deps/iconv
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/deps/regex
)
ENDIF
()
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/src/inc
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/src/os/inc
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/src/util/inc
)
...
...
src/os/src/detail/osFile.c
浏览文件 @
362fb3d3
...
...
@@ -70,7 +70,7 @@ ssize_t taosTReadImp(int fd, void *buf, size_t count) {
char
*
tbuf
=
(
char
*
)
buf
;
while
(
leftbytes
>
0
)
{
readbytes
=
read
(
fd
,
(
void
*
)
tbuf
,
leftbytes
);
readbytes
=
read
(
fd
,
(
void
*
)
tbuf
,
(
uint32_t
)
leftbytes
);
if
(
readbytes
<
0
)
{
if
(
errno
==
EINTR
)
{
continue
;
...
...
@@ -94,7 +94,7 @@ ssize_t taosTWriteImp(int fd, void *buf, size_t n) {
char
*
tbuf
=
(
char
*
)
buf
;
while
(
nleft
>
0
)
{
nwritten
=
write
(
fd
,
(
void
*
)
tbuf
,
nleft
);
nwritten
=
write
(
fd
,
(
void
*
)
tbuf
,
(
uint32_t
)
nleft
);
if
(
nwritten
<
0
)
{
if
(
errno
==
EINTR
)
{
continue
;
...
...
@@ -105,7 +105,7 @@ ssize_t taosTWriteImp(int fd, void *buf, size_t n) {
tbuf
+=
nwritten
;
}
return
n
;
return
(
ssize_t
)
n
;
}
#ifndef TAOS_OS_FUNC_FILE_SENDIFLE
...
...
src/os/src/detail/osRand.c
浏览文件 @
362fb3d3
...
...
@@ -26,11 +26,11 @@ uint32_t taosSafeRand(void) {
fd
=
open
(
"/dev/urandom"
,
0
);
if
(
fd
<
0
)
{
seed
=
time
(
0
);
seed
=
(
int
)
time
(
0
);
}
else
{
int
len
=
read
(
fd
,
&
seed
,
sizeof
(
seed
));
if
(
len
<
0
)
{
seed
=
time
(
0
);
seed
=
(
int
)
time
(
0
);
}
close
(
fd
);
}
...
...
src/os/src/detail/osTime.c
浏览文件 @
362fb3d3
...
...
@@ -165,7 +165,7 @@ int32_t parseTimezone(char* str, int64_t* tzOffset) {
char
*
sep
=
strchr
(
&
str
[
i
],
':'
);
if
(
sep
!=
NULL
)
{
int32_t
len
=
sep
-
&
str
[
i
]
;
int32_t
len
=
(
int32_t
)(
sep
-
&
str
[
i
])
;
hour
=
strnatoi
(
&
str
[
i
],
len
);
i
+=
len
+
1
;
...
...
@@ -212,7 +212,8 @@ int32_t parseTimeWithTz(char* timestr, int64_t* time, int32_t timePrec) {
/* mktime will be affected by TZ, set by using taos_options */
#ifdef WINDOWS
int64_t
seconds
=
gmtime
(
&
tm
);
int64_t
seconds
=
user_mktime64
(
tm
.
tm_year
+
1900
,
tm
.
tm_mon
+
1
,
tm
.
tm_mday
,
tm
.
tm_hour
,
tm
.
tm_min
,
tm
.
tm_sec
);
//int64_t seconds = gmtime(&tm);
#else
int64_t
seconds
=
timegm
(
&
tm
);
#endif
...
...
src/os/src/windows/w64File.c
浏览文件 @
362fb3d3
...
...
@@ -15,6 +15,7 @@
#define _DEFAULT_SOURCE
#include "os.h"
#include "tulog.h"
void
taosGetTmpfilePath
(
const
char
*
fileNamePrefix
,
char
*
dstPath
)
{
const
char
*
tdengineTmpFileNamePrefix
=
"tdengine-"
;
...
...
src/os/src/windows/w64Socket.c
浏览文件 @
362fb3d3
...
...
@@ -13,6 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "os.h"
#include <WS2tcpip.h>
#include <IPHlpApi.h>
#include <winsock2.h>
...
...
@@ -33,7 +34,7 @@ void taosWinSocketInit() {
}
}
int
taosSetNonblocking
(
SOCKET
sock
,
int
on
)
{
int
taosSetNonblocking
(
int
sock
,
int
on
)
{
u_long
mode
;
if
(
on
)
{
mode
=
1
;
...
...
src/os/src/windows/w64String.c
浏览文件 @
362fb3d3
...
...
@@ -67,7 +67,7 @@ char *getpass(const char *prefix) {
}
char
*
strndup
(
const
char
*
s
,
size_t
n
)
{
in
t
len
=
strlen
(
s
);
size_
t
len
=
strlen
(
s
);
if
(
len
>=
n
)
{
len
=
n
;
}
...
...
src/os/src/windows/w64Sysinfo.c
浏览文件 @
362fb3d3
...
...
@@ -43,7 +43,7 @@ static void taosGetSystemLocale() {
if
(
cfg_locale
&&
cfg_locale
->
cfgStatus
<
TAOS_CFG_CSTATUS_DEFAULT
)
{
char
*
locale
=
setlocale
(
LC_CTYPE
,
"chs"
);
if
(
locale
!=
NULL
)
{
tstrncpy
(
tsLocale
,
locale
,
sizeof
(
tsLocale
))
;
tstrncpy
(
tsLocale
,
locale
,
TSDB_LOCALE_LEN
);
;
cfg_locale
->
cfgStatus
=
TAOS_CFG_CSTATUS_DEFAULT
;
uInfo
(
"locale not configured, set to default:%s"
,
tsLocale
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录