only perform a single write and assert the amount written
This commit is contained in:
@@ -187,7 +187,8 @@ impl<Hw: Hardware> LocalExecutor<Hw> {
|
||||
if self.intx {
|
||||
let mut buf = [0_u8; core::mem::size_of::<usize>()];
|
||||
if (&self.irq_handle).read(&mut buf).unwrap() != 0 {
|
||||
(&self.irq_handle).write_all(&buf).unwrap();
|
||||
let amount = (&self.irq_handle).write(&buf).unwrap();
|
||||
assert!(amount == core::mem::size_of::<usize>());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -205,7 +205,8 @@ impl ProducerHandle {
|
||||
}
|
||||
|
||||
pub fn write_event(&mut self, event: orbclient::Event) -> io::Result<()> {
|
||||
self.0.write_all(&event)?;
|
||||
let amount = self.0.write(&event)?;
|
||||
assert!(amount == core::mem::size_of::<orbclient::Event>());
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user