diff --git a/xous-rs/src/process.rs b/xous-rs/src/process.rs index c0357d85f..a7bde40d1 100644 --- a/xous-rs/src/process.rs +++ b/xous-rs/src/process.rs @@ -1,5 +1,5 @@ pub fn id() -> u32 { - if let Ok(crate::Result::ProcessID(pid)) = crate::syscall::current_pid() { + if let Ok(pid) = crate::syscall::current_pid() { pid.get() as u32 } else { 0 diff --git a/xous-rs/src/syscall.rs b/xous-rs/src/syscall.rs index 1c242b5b8..5143dc561 100644 --- a/xous-rs/src/syscall.rs +++ b/xous-rs/src/syscall.rs @@ -1,7 +1,7 @@ use crate::{ pid_from_usize, CpuID, Error, MemoryAddress, MemoryFlags, MemoryMessage, MemoryRange, MemorySize, MemoryType, Message, MessageEnvelope, MessageSender, ProcessArgs, ProcessInit, - Result, ScalarMessage, SysCallResult, ThreadInit, CID, PID, SID, + Result, ScalarMessage, SysCallResult, ThreadInit, CID, PID, SID, TID, }; use core::convert::TryInto; @@ -1406,10 +1406,10 @@ pub fn wait_process(joiner: crate::arch::ProcessHandle) -> SysCallResult { } /// Get the current process ID -pub fn current_pid() -> SysCallResult { +pub fn current_pid() -> core::result::Result { rsyscall(SysCall::GetProcessId).and_then(|result| { if let Result::ProcessID(pid) = result { - Ok(Result::ProcessID(pid)) + Ok(pid) } else { Err(Error::InternalError) } @@ -1417,10 +1417,10 @@ pub fn current_pid() -> SysCallResult { } /// Get the current thread ID -pub fn current_tid() -> SysCallResult { - rsyscall(SysCall::GetProcessId).and_then(|result| { +pub fn current_tid() -> core::result::Result { + rsyscall(SysCall::GetThreadId).and_then(|result| { if let Result::ThreadID(tid) = result { - Ok(Result::ThreadID(tid)) + Ok(tid) } else { Err(Error::InternalError) }