mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
suggested method to preserve intent of drop to fix error
However, I didn't write this library (and I don't have a test suite for it), so I'm not quite sure if this preserves the invariants on the fd_mapping() structure. Needs @xobs' review.
This commit is contained in:
parent
e2dacdce35
commit
f0b351c2e0
2 changed files with 1 additions and 1 deletions
|
|
@ -517,7 +517,6 @@ pub(crate) fn close_key(
|
||||||
return Err(crate::PddbRetcode::UnexpectedEof);
|
return Err(crate::PddbRetcode::UnexpectedEof);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
core::mem::drop(file);
|
|
||||||
|
|
||||||
// If this SID is unused, close the connection.
|
// If this SID is unused, close the connection.
|
||||||
if let Some(cid) = conn {
|
if let Some(cid) = conn {
|
||||||
|
|
|
||||||
|
|
@ -1096,6 +1096,7 @@ fn wrapped_main() -> ! {
|
||||||
if let Err(e) = result {
|
if let Err(e) = result {
|
||||||
xous::return_scalar(msg.sender, e as usize)
|
xous::return_scalar(msg.sender, e as usize)
|
||||||
} else {
|
} else {
|
||||||
|
fd_mapping.remove(&msg.sender.pid());
|
||||||
xous::return_scalar2(msg.sender, 0, 0)
|
xous::return_scalar2(msg.sender, 0, 0)
|
||||||
}.ok();
|
}.ok();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue