Skip to content

Commit 4b25dcd

Browse files
authored
fix: 修复 #1387 错误的把sys_exit进行更改的bug (#1388)
Signed-off-by: longjin <[email protected]>
1 parent 17ba8f7 commit 4b25dcd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

kernel/src/process/syscall/sys_exit.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ impl Syscall for SysExit {
2020

2121
fn handle(&self, args: &[usize], _frame: &mut TrapFrame) -> Result<usize, SystemError> {
2222
let exit_code = Self::exit_code(args);
23-
ProcessManager::group_exit((exit_code & 0xff) << 8);
23+
// 仿照 Linux sys_exit:只取低 8 位并左移 8 位,形成 wstatus 编码,
24+
// 然后只退出当前线程(不退出整个线程组)。
25+
ProcessManager::exit((exit_code & 0xff) << 8);
2426
}
2527

2628
fn entry_format(&self, args: &[usize]) -> Vec<FormattedSyscallParam> {

0 commit comments

Comments
 (0)