Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
032d9761
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
032d9761
编写于
4月 29, 2022
作者:
wafwerar
提交者:
GitHub
4月 29, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #12024 from taosdata/fix/ZhiqiangWang/fix-14989-fix-win-open-file-error
fix(os): fix win open file error.
上级
05addd6c
f4f11fdc
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
40 addition
and
44 deletion
+40
-44
contrib/CMakeLists.txt
contrib/CMakeLists.txt
+1
-1
include/common/trow.h
include/common/trow.h
+1
-1
source/dnode/mnode/impl/test/sdb/sdbTest.cpp
source/dnode/mnode/impl/test/sdb/sdbTest.cpp
+16
-16
source/libs/scalar/src/sclfunc.c
source/libs/scalar/src/sclfunc.c
+1
-1
source/os/src/osDir.c
source/os/src/osDir.c
+2
-2
source/os/src/osFile.c
source/os/src/osFile.c
+4
-18
source/os/src/osSysinfo.c
source/os/src/osSysinfo.c
+10
-0
source/util/src/tconfig.c
source/util/src/tconfig.c
+5
-5
未找到文件。
contrib/CMakeLists.txt
浏览文件 @
032d9761
...
...
@@ -228,7 +228,7 @@ endif()
# iconv
if
(
${
BUILD_WITH_ICONV
}
)
add_
subdirectory
(
iconv EXCLUDE_FROM_ALL
)
add_
library
(
iconv STATIC iconv/win_iconv.c
)
endif
(
${
BUILD_WITH_ICONV
}
)
# wingetopt
...
...
include/common/trow.h
浏览文件 @
032d9761
...
...
@@ -1404,7 +1404,7 @@ static void tdSRowPrint(STSRow *row, STSchema *pSchema, const char* tag) {
printf
(
"%s >>>"
,
tag
);
for
(
int
i
=
0
;
i
<
pSchema
->
numOfCols
;
++
i
)
{
STColumn
*
stCol
=
pSchema
->
columns
+
i
;
SCellVal
sVal
=
{
.
valType
=
255
,
.
val
=
NULL
};
SCellVal
sVal
=
{
255
,
NULL
};
if
(
!
tdSTSRowIterNext
(
&
iter
,
stCol
->
colId
,
stCol
->
type
,
&
sVal
))
{
break
;
}
...
...
source/dnode/mnode/impl/test/sdb/sdbTest.cpp
浏览文件 @
032d9761
...
...
@@ -184,14 +184,14 @@ TEST_F(MndTestSdb, 01_Write) {
taosRemoveDir
(
opt
.
path
);
SSdbTable
strTable
=
{
.
sdbType
=
SDB_USER
,
.
keyType
=
SDB_KEY_BINARY
,
.
deployFp
=
(
SdbDeployFp
)
strDefault
,
.
encodeFp
=
(
SdbEncodeFp
)
strEncode
,
.
decodeFp
=
(
SdbDecodeFp
)
strDecode
,
.
insertFp
=
(
SdbInsertFp
)
strInsert
,
.
updateFp
=
(
SdbUpdateFp
)
strUpdate
,
.
deleteFp
=
(
SdbDeleteFp
)
strDelete
,
SDB_USER
,
SDB_KEY_BINARY
,
(
SdbDeployFp
)
strDefault
,
(
SdbEncodeFp
)
strEncode
,
(
SdbDecodeFp
)
strDecode
,
(
SdbInsertFp
)
strInsert
,
(
SdbUpdateFp
)
strUpdate
,
(
SdbDeleteFp
)
strDelete
,
};
pSdb
=
sdbInit
(
&
opt
);
...
...
@@ -304,14 +304,14 @@ TEST_F(MndTestSdb, 01_Read) {
taosRemoveDir
(
opt
.
path
);
SSdbTable
strTable
=
{
.
sdbType
=
SDB_USER
,
.
keyType
=
SDB_KEY_BINARY
,
.
deployFp
=
(
SdbDeployFp
)
strDefault
,
.
encodeFp
=
(
SdbEncodeFp
)
strEncode
,
.
decodeFp
=
(
SdbDecodeFp
)
strDecode
,
.
insertFp
=
(
SdbInsertFp
)
strInsert
,
.
updateFp
=
(
SdbUpdateFp
)
strDele
te
,
.
deleteFp
=
(
SdbDeleteFp
)
strUpda
te
,
SDB_USER
,
SDB_KEY_BINARY
,
(
SdbDeployFp
)
strDefault
,
(
SdbEncodeFp
)
strEncode
,
(
SdbDecodeFp
)
strDecode
,
(
SdbInsertFp
)
strInsert
,
(
SdbUpdateFp
)
strUpda
te
,
(
SdbDeleteFp
)
strDele
te
,
};
pSdb
=
sdbInit
(
&
opt
);
...
...
source/libs/scalar/src/sclfunc.c
浏览文件 @
032d9761
...
...
@@ -170,7 +170,7 @@ static int32_t doScalarFunctionUnique2(SScalarParam *pInput, int32_t inputNum, S
double
*
out
=
(
double
*
)
pOutputData
->
pData
;
double
result
;
int32_t
numOfRows
=
MAX
(
pInput
[
0
].
numOfRows
,
pInput
[
1
].
numOfRows
);
int32_t
numOfRows
=
T
MAX
(
pInput
[
0
].
numOfRows
,
pInput
[
1
].
numOfRows
);
if
(
pInput
[
0
].
numOfRows
==
pInput
[
1
].
numOfRows
)
{
for
(
int32_t
i
=
0
;
i
<
numOfRows
;
++
i
)
{
if
(
colDataIsNull_s
(
pInputData
[
0
],
i
)
||
...
...
source/os/src/osDir.c
浏览文件 @
032d9761
...
...
@@ -40,11 +40,11 @@ int wordexp(char *words, wordexp_t *pwordexp, int flags) {
memset
(
pwordexp
->
wordPos
,
0
,
1025
);
if
(
_fullpath
(
pwordexp
->
wordPos
,
words
,
1024
)
==
NULL
)
{
pwordexp
->
we_wordv
[
0
]
=
words
;
printf
(
"failed to parse relative path:%s to abs path"
,
words
);
printf
(
"failed to parse relative path:%s to abs path
\n
"
,
words
);
return
-
1
;
}
printf
(
"parse relative path:%s to abs path:%s"
,
words
,
pwordexp
->
wordPos
);
printf
(
"parse relative path:%s to abs path:%s
\n
"
,
words
,
pwordexp
->
wordPos
);
return
0
;
}
...
...
source/os/src/osFile.c
浏览文件 @
032d9761
...
...
@@ -22,20 +22,6 @@
#define W_OK 2
#define R_OK 4
#if defined(_MSDOS)
#define open _open
#endif
#if defined(_WIN32)
extern
int
openA
(
const
char
*
,
int
,
...);
/* MsvcLibX ANSI version of open */
extern
int
openU
(
const
char
*
,
int
,
...);
/* MsvcLibX UTF-8 version of open */
#if defined(_UTF8_SOURCE) || defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
#define open openU
#else
/* _ANSI_SOURCE */
#define open openA
#endif
/* defined(_UTF8_SOURCE) */
#endif
/* defined(_WIN32) */
#define _SEND_FILE_STEP_ 1000
#else
...
...
@@ -228,9 +214,6 @@ int32_t taosDevInoFile(const char *path, int64_t *stDev, int64_t *stIno) {
void
autoDelFileListAdd
(
const
char
*
path
)
{
return
;
}
TdFilePtr
taosOpenFile
(
const
char
*
path
,
int32_t
tdFileOptions
)
{
#ifdef WINDOWS
return
NULL
;
#else
int
fd
=
-
1
;
FILE
*
fp
=
NULL
;
if
(
tdFileOptions
&
TD_FILE_STREAM
)
{
...
...
@@ -263,7 +246,11 @@ TdFilePtr taosOpenFile(const char *path, int32_t tdFileOptions) {
access
|=
(
tdFileOptions
&
TD_FILE_APPEND
)
?
O_APPEND
:
0
;
access
|=
(
tdFileOptions
&
TD_FILE_TEXT
)
?
O_TEXT
:
0
;
access
|=
(
tdFileOptions
&
TD_FILE_EXCL
)
?
O_EXCL
:
0
;
#ifdef WINDOWS
fd
=
_open
(
path
,
access
,
_S_IREAD
|
_S_IWRITE
);
#else
fd
=
open
(
path
,
access
,
S_IRWXU
|
S_IRWXG
|
S_IRWXO
);
#endif
if
(
fd
==
-
1
)
{
return
NULL
;
}
...
...
@@ -286,7 +273,6 @@ TdFilePtr taosOpenFile(const char *path, int32_t tdFileOptions) {
pFile
->
fp
=
fp
;
pFile
->
refId
=
0
;
return
pFile
;
#endif
}
int64_t
taosCloseFile
(
TdFilePtr
*
ppFile
)
{
...
...
source/os/src/osSysinfo.c
浏览文件 @
032d9761
...
...
@@ -866,6 +866,16 @@ void taosSetCoreDump(bool enable) {
SysNameInfo
taosGetSysNameInfo
()
{
#ifdef WINDOWS
SysNameInfo
info
=
{
0
};
DWORD
dwVersion
=
GetVersion
();
tstrncpy
(
info
.
sysname
,
getenv
(
"OS"
),
sizeof
(
info
.
sysname
));
tstrncpy
(
info
.
nodename
,
getenv
(
"COMPUTERNAME"
),
sizeof
(
info
.
nodename
));
sprintf_s
(
info
.
release
,
sizeof
(
info
.
release
),
"%d"
,
dwVersion
&
0x0F
);
sprintf_s
(
info
.
version
,
sizeof
(
info
.
release
),
"%d"
,
(
dwVersion
>>
8
)
&
0x0F
);
tstrncpy
(
info
.
machine
,
getenv
(
"PROCESSOR_ARCHITECTURE"
),
sizeof
(
info
.
machine
));
return
info
;
#elif defined(_TD_DARWIN_64)
SysNameInfo
info
=
{
0
};
...
...
source/util/src/tconfig.c
浏览文件 @
032d9761
...
...
@@ -687,13 +687,13 @@ int32_t cfgLoadFromEnvFile(SConfig *pConfig, const char *envFile) {
const
char
*
filepath
=
".env"
;
if
(
envFile
!=
NULL
&&
strlen
(
envFile
)
>
0
)
{
if
(
!
taosCheckExistFile
(
envFile
))
{
uError
(
"f
ial
to load env file: %s"
,
envFile
);
uError
(
"f
ailed
to load env file: %s"
,
envFile
);
return
-
1
;
}
filepath
=
envFile
;
}
else
{
if
(
!
taosCheckExistFile
(
filepath
))
{
uInfo
(
"f
ial
to load env file: %s"
,
filepath
);
uInfo
(
"f
ailed
to load env file: %s"
,
filepath
);
return
0
;
}
}
...
...
@@ -826,7 +826,7 @@ int32_t cfgLoadFromApollUrl(SConfig *pConfig, const char *url) {
if
(
strncmp
(
url
,
"jsonFile"
,
8
)
==
0
)
{
char
*
filepath
=
p
;
if
(
!
taosCheckExistFile
(
filepath
))
{
uError
(
"f
ial
to load json file: %s"
,
filepath
);
uError
(
"f
ailed
to load json file: %s"
,
filepath
);
return
-
1
;
}
...
...
@@ -957,13 +957,13 @@ int32_t cfgGetApollUrl(const char **envCmd, const char *envFile, char* apolloUrl
const
char
*
filepath
=
".env"
;
if
(
envFile
!=
NULL
&&
strlen
(
envFile
)
>
0
)
{
if
(
!
taosCheckExistFile
(
envFile
))
{
uError
(
"f
ial
to load env file: %s"
,
envFile
);
uError
(
"f
ailed
to load env file: %s"
,
envFile
);
return
-
1
;
}
filepath
=
envFile
;
}
else
{
if
(
!
taosCheckExistFile
(
filepath
))
{
uInfo
(
"f
ial
to load env file: %s"
,
filepath
);
uInfo
(
"f
ailed
to load env file: %s"
,
filepath
);
return
0
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录