修复Ctrl+C会终止所有进程的问题

Signed-off-by: huangshan <huangshan9@huawei.com>
Change-Id: I5861569c63fd6c1adf8c702797e4d79eba76211f
This commit is contained in:
huangshan
2021-11-03 09:58:22 +08:00
parent 23c4f2b81b
commit cdc0877f16
7 changed files with 53 additions and 35 deletions

View File

@@ -97,6 +97,9 @@ static int DoShellExec(char **argv)
int ret = SH_NOK;
char *cmdLine = NULL;
if (strncmp(argv[0], SHELL_EXEC_COMMAND, SHELL_EXEC_COMMAND_BYTES) == 0) {
ChildExec(argv[1], argv + 1);
}
for (i = 0; argv[i]; i++) {
len += strlen(argv[i]);
}
@@ -123,7 +126,7 @@ int main(int argc, char **argv)
int ret = SH_NOK;
ShellCB *shellCB = NULL;
if (!strcmp(argv[0], "shell") && argv[1]) {
if (argc > 1) {
ret = DoShellExec(argv + 1);
return ret;
}