修复了wait4的异常报错 (#312)

* 修复了wait4的异常报错
This commit is contained in:
Chiichen
2023-08-02 14:29:59 +08:00
committed by GitHub
parent 821bb9a2dc
commit 4da3758acf
2 changed files with 9 additions and 2 deletions

View File

@ -41,8 +41,9 @@ impl Syscall {
) -> Result<usize, SystemError> {
let ret = unsafe { c_sys_wait4(pid, wstatus, options, rusage) };
if (ret as isize) < 0 {
return Err(SystemError::from_posix_errno(-(ret as isize) as i32)
.expect("wait4: Invalid errno"));
return Err(
SystemError::from_posix_errno((ret as isize) as i32).expect("wait4: Invalid errno")
);
}
return Ok(ret as usize);
}