fix: 修复 #1387 错误的把sys_exit进行更改的bug (#1388)

Signed-off-by: longjin <longjin@DragonOS.org>
This commit is contained in:
LoGin 2025-11-20 00:29:23 +08:00 committed by GitHub
parent 17ba8f721a
commit 4b25dcded2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -20,7 +20,9 @@ impl Syscall for SysExit {
fn handle(&self, args: &[usize], _frame: &mut TrapFrame) -> Result<usize, SystemError> {
let exit_code = Self::exit_code(args);
ProcessManager::group_exit((exit_code & 0xff) << 8);
// 仿照 Linux sys_exit只取低 8 位并左移 8 位,形成 wstatus 编码,
// 然后只退出当前线程(不退出整个线程组)。
ProcessManager::exit((exit_code & 0xff) << 8);
}
fn entry_format(&self, args: &[usize]) -> Vec<FormattedSyscallParam> {