修复Ctrl+C会终止所有进程的问题
Signed-off-by: huangshan <huangshan9@huawei.com> Change-Id: I5861569c63fd6c1adf8c702797e4d79eba76211f
This commit is contained in:
@@ -436,17 +436,16 @@ STATIC VOID StoreReadChar(CONSOLE_CB *consoleCB, char ch, INT32 readcount)
|
||||
}
|
||||
}
|
||||
|
||||
VOID KillPgrp()
|
||||
VOID KillPgrp(UINT16 consoleId)
|
||||
{
|
||||
INT32 consoleId;
|
||||
LosProcessCB *process = OsCurrProcessGet();
|
||||
|
||||
if ((process->consoleID > CONSOLE_NUM - 1) || (process->consoleID < 0)) {
|
||||
if ((consoleId > CONSOLE_NUM) || (consoleId <= 0)) {
|
||||
return;
|
||||
}
|
||||
CONSOLE_CB *consoleCB = g_console[consoleId-1];
|
||||
/* the default of consoleCB->pgrpId is -1, may not be set yet, avoid killing all processes */
|
||||
if (consoleCB->pgrpId < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
consoleId = process->consoleID;
|
||||
CONSOLE_CB *consoleCB = g_console[consoleId];
|
||||
(VOID)OsKillLock(consoleCB->pgrpId, SIGINT);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user