mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
xous: don't panic when non-Ok is returned by send_message
Sometimes the queue is full, in which case something other than Ok is returned. Don't panic when this happens. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
179623e083
commit
87c7335afc
1 changed files with 4 additions and 4 deletions
|
|
@ -823,13 +823,13 @@ pub fn receive_message(server: SID) -> core::result::Result<MessageEnvelope, Err
|
|||
///
|
||||
/// * **ServerNotFound**: The server does not exist so the connection is now invalid
|
||||
/// * **BadAddress**: The client tried to pass a Memory message using an address it doesn't own
|
||||
/// * **ServerQueueFull**: The queue in the server is full, and this call would block
|
||||
/// * **Timeout**: The timeout limit has been reached
|
||||
pub fn send_message(connection: CID, message: Message) -> core::result::Result<(), Error> {
|
||||
let result =
|
||||
rsyscall(SysCall::SendMessage(connection, message)).expect("couldn't send message");
|
||||
if let Result::Ok = result {
|
||||
let result = rsyscall(SysCall::SendMessage(connection, message));
|
||||
if let Ok(Result::Ok) = result {
|
||||
Ok(())
|
||||
} else if let Result::Error(e) = result {
|
||||
} else if let Err(e) = result {
|
||||
Err(e)
|
||||
} else {
|
||||
panic!("Unexpected return value: {:?}", result);
|
||||
|
|
|
|||
Loading…
Reference in a new issue