Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a1147241
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看板
未验证
提交
a1147241
编写于
4月 13, 2022
作者:
wafwerar
提交者:
GitHub
4月 13, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #11455 from taosdata/fix/ZhiqiangWang/TD-13254-fix-taosd-k
fix(grant): taosd -k.
上级
6eba8ad1
5034cf4e
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
57 addition
and
9 deletion
+57
-9
include/os/osFile.h
include/os/osFile.h
+1
-1
include/os/osSystem.h
include/os/osSystem.h
+7
-0
source/dnode/mgmt/CMakeLists.txt
source/dnode/mgmt/CMakeLists.txt
+1
-1
source/dnode/mgmt/exe/dndMain.c
source/dnode/mgmt/exe/dndMain.c
+1
-1
source/dnode/mnode/impl/CMakeLists.txt
source/dnode/mnode/impl/CMakeLists.txt
+7
-0
source/dnode/mnode/impl/inc/mndGrant.h
source/dnode/mnode/impl/inc/mndGrant.h
+2
-2
source/dnode/mnode/impl/src/mndGrant.c
source/dnode/mnode/impl/src/mndGrant.c
+3
-3
source/dnode/mnode/impl/src/mnode.c
source/dnode/mnode/impl/src/mnode.c
+2
-0
source/os/src/osFile.c
source/os/src/osFile.c
+1
-1
source/os/src/osSystem.c
source/os/src/osSystem.c
+32
-0
未找到文件。
include/os/osFile.h
浏览文件 @
a1147241
...
...
@@ -79,7 +79,7 @@ int64_t taosPReadFile(TdFilePtr pFile, void *buf, int64_t count, int64_t offset)
int64_t
taosWriteFile
(
TdFilePtr
pFile
,
const
void
*
buf
,
int64_t
count
);
void
taosFprintfFile
(
TdFilePtr
pFile
,
const
char
*
format
,
...);
int64_t
taosGetLineFile
(
TdFilePtr
pFile
,
char
**
__restrict
__
ptrBuf
);
int64_t
taosGetLineFile
(
TdFilePtr
pFile
,
char
**
__restrict
ptrBuf
);
int32_t
taosEOFFile
(
TdFilePtr
pFile
);
...
...
include/os/osSystem.h
浏览文件 @
a1147241
...
...
@@ -29,6 +29,13 @@ extern "C" {
#define tcgetattr TCGETATTR_FUNC_TAOS_FORBID
#endif
typedef
struct
TdCmd
*
TdCmdPtr
;
TdCmdPtr
taosOpenCmd
(
const
char
*
cmd
);
int64_t
taosGetLineCmd
(
TdCmdPtr
pCmd
,
char
**
__restrict
ptrBuf
);
int32_t
taosEOFCmd
(
TdCmdPtr
pCmd
);
int64_t
taosCloseCmd
(
TdCmdPtr
*
ppCmd
);
void
*
taosLoadDll
(
const
char
*
filename
);
void
*
taosLoadSym
(
void
*
handle
,
char
*
name
);
void
taosCloseDll
(
void
*
handle
);
...
...
source/dnode/mgmt/CMakeLists.txt
浏览文件 @
a1147241
...
...
@@ -20,6 +20,7 @@ add_executable(taosd ${EXEC_SRC})
target_include_directories
(
taosd
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc"
PRIVATE
"
${
TD_SOURCE_DIR
}
/source/dnode/mnode/impl/inc"
)
target_link_libraries
(
taosd dnode
)
...
...
@@ -28,7 +29,6 @@ IF (TD_GRANT)
ENDIF
()
IF
(
TD_USB_DONGLE
)
TARGET_LINK_LIBRARIES
(
taosd usb_dongle
)
else
()
ENDIF
()
if
(
${
BUILD_TEST
}
)
...
...
source/dnode/mgmt/exe/dndMain.c
浏览文件 @
a1147241
...
...
@@ -16,7 +16,7 @@
#define _DEFAULT_SOURCE
#include "dndInt.h"
#include "tconfig.h"
#include "
tg
rant.h"
#include "
mndG
rant.h"
static
struct
{
bool
dumpConfig
;
...
...
source/dnode/mnode/impl/CMakeLists.txt
浏览文件 @
a1147241
...
...
@@ -9,6 +9,13 @@ target_link_libraries(
mnode scheduler sdb wal transport cjson sync monitor executor qworker stream parser
)
IF
(
TD_GRANT
)
TARGET_LINK_LIBRARIES
(
mnode grant
)
ENDIF
()
IF
(
TD_USB_DONGLE
)
TARGET_LINK_LIBRARIES
(
mnode usb_dongle
)
ENDIF
()
if
(
${
BUILD_TEST
}
)
add_subdirectory
(
test
)
endif
(
${
BUILD_TEST
}
)
include/common/tg
rant.h
→
source/dnode/mnode/impl/inc/mndG
rant.h
浏览文件 @
a1147241
...
...
@@ -36,8 +36,8 @@ typedef enum {
TSDB_GRANT_CPU_CORES
,
}
EGrantType
;
int32_t
grantIni
t
();
void
grantCleanUp
();
int32_t
mndInitGran
t
();
void
mndCleanupGrant
();
void
grantParseParameter
();
int32_t
grantCheck
(
EGrantType
grant
);
void
grantReset
(
EGrantType
grant
,
uint64_t
value
);
...
...
source/dnode/mnode/impl/src/mndGrant.c
浏览文件 @
a1147241
...
...
@@ -17,11 +17,11 @@
#ifndef _GRANT
#include "os.h"
#include "taoserror.h"
#include "
tg
rant.h"
#include "
mndG
rant.h"
#include "mndInt.h"
int32_t
grantInit
(
)
{
return
TSDB_CODE_SUCCESS
;
}
void
grantCleanUp
()
{}
int32_t
mndInitGrant
(
SMnode
*
pMnode
)
{
return
TSDB_CODE_SUCCESS
;
}
void
mndCleanupGrant
()
{}
void
grantParseParameter
()
{
mError
(
"can't parsed parameter k"
);
}
int32_t
grantCheck
(
EGrantType
grant
)
{
return
TSDB_CODE_SUCCESS
;
}
void
grantReset
(
EGrantType
grant
,
uint64_t
value
)
{}
...
...
source/dnode/mnode/impl/src/mnode.c
浏览文件 @
a1147241
...
...
@@ -40,6 +40,7 @@
#include "mndUser.h"
#include "mndVgroup.h"
#include "mndQuery.h"
#include "mndGrant.h"
#define MQ_TIMER_MS 3000
#define TRNAS_TIMER_MS 6000
...
...
@@ -197,6 +198,7 @@ static int32_t mndInitSteps(SMnode *pMnode, bool deploy) {
if
(
mndAllocStep
(
pMnode
,
"mnode-qnode"
,
mndInitBnode
,
mndCleanupBnode
)
!=
0
)
return
-
1
;
if
(
mndAllocStep
(
pMnode
,
"mnode-dnode"
,
mndInitDnode
,
mndCleanupDnode
)
!=
0
)
return
-
1
;
if
(
mndAllocStep
(
pMnode
,
"mnode-user"
,
mndInitUser
,
mndCleanupUser
)
!=
0
)
return
-
1
;
if
(
mndAllocStep
(
pMnode
,
"mnode-grant"
,
mndInitGrant
,
mndCleanupGrant
)
!=
0
)
return
-
1
;
if
(
mndAllocStep
(
pMnode
,
"mnode-auth"
,
mndInitAuth
,
mndCleanupAuth
)
!=
0
)
return
-
1
;
if
(
mndAllocStep
(
pMnode
,
"mnode-acct"
,
mndInitAcct
,
mndCleanupAcct
)
!=
0
)
return
-
1
;
if
(
mndAllocStep
(
pMnode
,
"mnode-stream"
,
mndInitStream
,
mndCleanupStream
)
!=
0
)
return
-
1
;
...
...
source/os/src/osFile.c
浏览文件 @
a1147241
...
...
@@ -768,7 +768,7 @@ int32_t taosUmaskFile(int32_t maskVal) {
}
int32_t
taosGetErrorFile
(
TdFilePtr
pFile
)
{
return
errno
;
}
int64_t
taosGetLineFile
(
TdFilePtr
pFile
,
char
**
__restrict
__
ptrBuf
)
{
int64_t
taosGetLineFile
(
TdFilePtr
pFile
,
char
**
__restrict
ptrBuf
)
{
if
(
pFile
==
NULL
)
{
return
-
1
;
}
...
...
source/os/src/osSystem.c
浏览文件 @
a1147241
...
...
@@ -29,6 +29,8 @@
struct
termios
oldtio
;
#endif
typedef
struct
FILE
TdCmd
;
void
*
taosLoadDll
(
const
char
*
filename
)
{
#if defined(WINDOWS)
return
NULL
;
...
...
@@ -178,3 +180,33 @@ void resetTerminalMode() {
}
#endif
}
TdCmdPtr
taosOpenCmd
(
const
char
*
cmd
)
{
if
(
cmd
==
NULL
)
return
NULL
;
return
(
TdCmdPtr
)
popen
(
cmd
,
"r"
);
}
int64_t
taosGetLineCmd
(
TdCmdPtr
pCmd
,
char
**
__restrict
ptrBuf
)
{
if
(
pCmd
==
NULL
)
{
return
-
1
;
}
size_t
len
=
0
;
return
getline
(
ptrBuf
,
&
len
,
(
FILE
*
)
pCmd
);
}
int32_t
taosEOFCmd
(
TdCmdPtr
pCmd
)
{
if
(
pCmd
==
NULL
)
{
return
0
;
}
return
feof
((
FILE
*
)
pCmd
);
}
int64_t
taosCloseCmd
(
TdCmdPtr
*
ppCmd
)
{
if
(
ppCmd
==
NULL
||
*
ppCmd
==
NULL
)
{
return
0
;
}
pclose
((
FILE
*
)(
*
ppCmd
));
*
ppCmd
=
NULL
;
return
0
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录