提交 93938aab 编写于 作者: S Shengliang Guan

refactor(tools): disable ctrl+c

上级 780561bc
......@@ -881,6 +881,10 @@ void shellGetGrantInfo() {
void shellQueryInterruptHandler(int32_t signum, void *sigInfo, void *context) { tsem_post(&shell.cancelSem); }
void shellSigintHandler(int32_t signum, void *sigInfo, void *context) {
// do nothing
}
void shellCleanup(void *arg) { taosResetTerminalMode(); }
void *shellCancelHandler(void *arg) {
......@@ -892,7 +896,7 @@ void *shellCancelHandler(void *arg) {
}
taosResetTerminalMode();
printf("\nReceive ctrl+c or other signal, quit shell.\n");
printf("\nReceive SIGTERM or other signal, quit shell.\n");
shellWriteHistory();
shellExit();
}
......@@ -974,10 +978,11 @@ int32_t shellExecute() {
taosThreadCreate(&spid, NULL, shellCancelHandler, NULL);
taosSetSignal(SIGTERM, shellQueryInterruptHandler);
taosSetSignal(SIGINT, shellQueryInterruptHandler);
taosSetSignal(SIGHUP, shellQueryInterruptHandler);
taosSetSignal(SIGABRT, shellQueryInterruptHandler);
taosSetSignal(SIGINT, shellSigintHandler);
shellGetGrantInfo(shell.conn);
while (1) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册