Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
597291e0
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
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看板
未验证
提交
597291e0
编写于
6月 22, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
6月 22, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2414 from taosdata/hotfix/test
[modify for covrity scan]
上级
996c175a
b25c36c3
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
16 addition
and
11 deletion
+16
-11
src/kit/shell/src/shellLinux.c
src/kit/shell/src/shellLinux.c
+3
-3
src/kit/taosdump/taosdump.c
src/kit/taosdump/taosdump.c
+1
-1
src/os/linux/src/linuxSysPara.c
src/os/linux/src/linuxSysPara.c
+2
-2
src/util/inc/tutil.h
src/util/inc/tutil.h
+1
-1
src/util/src/tnote.c
src/util/src/tnote.c
+5
-4
src/util/src/tutil.c
src/util/src/tutil.c
+2
-0
src/util/tests/stringTest.cpp
src/util/tests/stringTest.cpp
+2
-0
未找到文件。
src/kit/shell/src/shellLinux.c
浏览文件 @
597291e0
...
...
@@ -86,7 +86,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
wordfree
(
&
full_path
);
return
-
1
;
}
strcpy
(
configDir
,
full_path
.
we_wordv
[
0
]
);
tstrncpy
(
configDir
,
full_path
.
we_wordv
[
0
],
TSDB_FILENAME_LEN
);
wordfree
(
&
full_path
);
break
;
case
's'
:
...
...
@@ -100,7 +100,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
fprintf
(
stderr
,
"Invalid path %s
\n
"
,
arg
);
return
-
1
;
}
strcpy
(
arguments
->
file
,
full_path
.
we_wordv
[
0
]
);
tstrncpy
(
arguments
->
file
,
full_path
.
we_wordv
[
0
],
TSDB_FILENAME_LEN
);
wordfree
(
&
full_path
);
break
;
case
'D'
:
...
...
@@ -108,7 +108,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
fprintf
(
stderr
,
"Invalid path %s
\n
"
,
arg
);
return
-
1
;
}
strcpy
(
arguments
->
dir
,
full_path
.
we_wordv
[
0
]
);
tstrncpy
(
arguments
->
dir
,
full_path
.
we_wordv
[
0
],
TSDB_FILENAME_LEN
);
wordfree
(
&
full_path
);
break
;
case
'T'
:
...
...
src/kit/taosdump/taosdump.c
浏览文件 @
597291e0
...
...
@@ -655,7 +655,7 @@ int taosDumpDb(SDbInfo *dbInfo, SDumpArguments *arguments, FILE *fp) {
}
close
(
fd
);
remove
(
".table.tmp"
);
(
void
)
remove
(
".table.tmp"
);
return
0
;
}
...
...
src/os/linux/src/linuxSysPara.c
浏览文件 @
597291e0
...
...
@@ -553,7 +553,7 @@ void taosSetCoreDump() {
struct
rlimit
rlim
;
struct
rlimit
rlim_new
;
if
(
getrlimit
(
RLIMIT_CORE
,
&
rlim
)
==
0
)
{
uPrint
(
"the old unlimited para: rlim_cur=%"
PRIu64
,
", rlim_max=%"
PRIu64
,
rlim
.
rlim_cur
,
rlim
.
rlim_max
);
uPrint
(
"the old unlimited para: rlim_cur=%"
PRIu64
", rlim_max=%"
PRIu64
,
rlim
.
rlim_cur
,
rlim
.
rlim_max
);
rlim_new
.
rlim_cur
=
RLIM_INFINITY
;
rlim_new
.
rlim_max
=
RLIM_INFINITY
;
if
(
setrlimit
(
RLIMIT_CORE
,
&
rlim_new
)
!=
0
)
{
...
...
@@ -565,7 +565,7 @@ void taosSetCoreDump() {
}
if
(
getrlimit
(
RLIMIT_CORE
,
&
rlim
)
==
0
)
{
uPrint
(
"the new unlimited para: rlim_cur=%"
PRIu64
,
", rlim_max=%"
PRIu64
,
rlim
.
rlim_cur
,
rlim
.
rlim_max
);
uPrint
(
"the new unlimited para: rlim_cur=%"
PRIu64
", rlim_max=%"
PRIu64
,
rlim
.
rlim_cur
,
rlim
.
rlim_max
);
}
#ifndef _TD_ARM_
...
...
src/util/inc/tutil.h
浏览文件 @
597291e0
...
...
@@ -135,7 +135,7 @@ char* strtolower(char *dst, const char *src);
int64_t
strnatoi
(
char
*
num
,
int32_t
len
);
char
*
strreplace
(
const
char
*
str
,
const
char
*
pattern
,
const
char
*
rep
);
//
char* strreplace(const char* str, const char* pattern, const char* rep);
char
*
strbetween
(
char
*
string
,
char
*
begin
,
char
*
end
);
...
...
src/util/src/tnote.c
浏览文件 @
597291e0
...
...
@@ -208,14 +208,15 @@ int taosOpenNoteWithMaxLines(char *fn, int maxLines, int maxNoteNum, taosNoteInf
}
}
sprintf
(
name
,
"%s.%d"
,
pNote
->
taosNoteName
,
pNote
->
taosNoteFlag
);
char
noteName
[
NOTE_FILE_NAME_LEN
*
2
]
=
"
\0
"
;
sprintf
(
noteName
,
"%s.%d"
,
pNote
->
taosNoteName
,
pNote
->
taosNoteFlag
);
pthread_mutex_init
(
&
pNote
->
taosNoteMutex
,
NULL
);
umask
(
0
);
pNote
->
taosNoteFd
=
open
(
name
,
O_WRONLY
|
O_CREAT
,
S_IRWXU
|
S_IRWXG
|
S_IRWXO
);
pNote
->
taosNoteFd
=
open
(
n
oteN
ame
,
O_WRONLY
|
O_CREAT
,
S_IRWXU
|
S_IRWXG
|
S_IRWXO
);
if
(
pNote
->
taosNoteFd
<
0
)
{
fprintf
(
stderr
,
"failed to open note file:%s reason:%s
\n
"
,
name
,
strerror
(
errno
));
fprintf
(
stderr
,
"failed to open note file:%s reason:%s
\n
"
,
n
oteN
ame
,
strerror
(
errno
));
return
-
1
;
}
taosLockNote
(
pNote
->
taosNoteFd
,
pNote
);
...
...
@@ -223,7 +224,7 @@ int taosOpenNoteWithMaxLines(char *fn, int maxLines, int maxNoteNum, taosNoteInf
// only an estimate for number of lines
struct
stat
filestat
;
if
(
fstat
(
pNote
->
taosNoteFd
,
&
filestat
)
<
0
)
{
fprintf
(
stderr
,
"failed to fstat note file:%s reason:%s
\n
"
,
name
,
strerror
(
errno
));
fprintf
(
stderr
,
"failed to fstat note file:%s reason:%s
\n
"
,
n
oteN
ame
,
strerror
(
errno
));
return
-
1
;
}
size
=
(
int
)
filestat
.
st_size
;
...
...
src/util/src/tutil.c
浏览文件 @
597291e0
...
...
@@ -314,6 +314,7 @@ int64_t strnatoi(char *num, int32_t len) {
return
ret
;
}
#if 0
FORCE_INLINE size_t getLen(size_t old, size_t size) {
if (old == 1) {
old = 2;
...
...
@@ -401,6 +402,7 @@ char *strreplace(const char *str, const char *pattern, const char *rep) {
return dest;
}
#endif
char
*
strbetween
(
char
*
string
,
char
*
begin
,
char
*
end
)
{
char
*
result
=
NULL
;
...
...
src/util/tests/stringTest.cpp
浏览文件 @
597291e0
...
...
@@ -26,6 +26,7 @@ TEST(testCase, string_dequote_test) {
EXPECT_EQ
(
3
,
lx
);
}
#if 0
TEST(testCase, string_replace_test) {
char t3[] = "abc01abc02abc";
char* ret = strreplace(t3, "abc", "7");
...
...
@@ -87,6 +88,7 @@ TEST(testCase, string_replace_test) {
EXPECT_STREQ("abcdef", ret);
free(ret);
}
#endif
TEST
(
testCase
,
string_tolower_test
)
{
char
t
[
1024
]
=
{
1
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录