mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-26 02:43:24 +00:00
Fix panic in sys_waitid()
by options
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
ec7391468c
commit
ef9e600c9d
@ -16,7 +16,8 @@ pub fn sys_waitid(
|
||||
) -> Result<SyscallReturn> {
|
||||
// FIXME: what does infoq and rusage use for?
|
||||
let process_filter = ProcessFilter::from_which_and_id(which, upid)?;
|
||||
let wait_options = WaitOptions::from_bits(options as u32).expect("Unknown wait options");
|
||||
let wait_options = WaitOptions::from_bits(options as u32)
|
||||
.ok_or(Error::with_message(Errno::EINVAL, "invalid options"))?;
|
||||
let waited_process = wait_child_exit(process_filter, wait_options)?;
|
||||
let pid = waited_process.map_or(0, |process| process.pid());
|
||||
Ok(SyscallReturn::Return(pid as _))
|
||||
|
Reference in New Issue
Block a user