Compare commits
2 Commits
c36b14314f
...
201eaf576a
Author | SHA1 | Date | |
---|---|---|---|
201eaf576a | |||
8fa25a4322 |
@ -246,11 +246,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
|
||||
impl ExitStatus {
|
||||
pub fn exit_ok(&self) -> Result<(), ExitStatusError> {
|
||||
if self.0 == 0 {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(ExitStatusError(self.0))
|
||||
}
|
||||
if self.0 == 0 { Ok(()) } else { Err(ExitStatusError(self.0)) }
|
||||
}
|
||||
|
||||
pub fn code(&self) -> Option<i32> {
|
||||
@ -318,7 +314,8 @@ pub fn wait(&mut self) -> io::Result<ExitStatus> {
|
||||
return unsupported();
|
||||
};
|
||||
let wait_res: Result<(u64, u8), Errno> = postcard::from_bytes(
|
||||
&rpc::send_call(proc_man_pid, 8, 5, &postcard::to_allocvec(&(self.pid, true)).unwrap()).get_return(),
|
||||
&rpc::send_call(proc_man_pid, 8, 5, &postcard::to_allocvec(&(self.pid, true)).unwrap())
|
||||
.get_return(),
|
||||
)
|
||||
.unwrap();
|
||||
let (_wait_pid, code) = wait_res?;
|
||||
@ -330,7 +327,8 @@ pub fn try_wait(&mut self) -> io::Result<Option<ExitStatus>> {
|
||||
return unsupported();
|
||||
};
|
||||
let wait_res: Result<(u64, u8), Errno> = postcard::from_bytes(
|
||||
&rpc::send_call(proc_man_pid, 8, 5, &postcard::to_allocvec(&(self.pid, true)).unwrap()).get_return(),
|
||||
&rpc::send_call(proc_man_pid, 8, 5, &postcard::to_allocvec(&(self.pid, true)).unwrap())
|
||||
.get_return(),
|
||||
)
|
||||
.unwrap();
|
||||
let (_wait_pid, code) = match wait_res {
|
||||
|
@ -13,6 +13,6 @@ pub extern "C" fn _start() {
|
||||
unsafe {
|
||||
asm!("int 0x80", in("rax") 19, lateout("rax") argv, lateout("rcx") argc);
|
||||
let code = main(argc, argv);
|
||||
crate::sys::os::exit(code as u8);
|
||||
crate::sys::os::exit(code);
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user