mirror of
https://github.com/htrefil/rkvm.git
synced 2025-01-30 20:34:13 +01:00
Don't write timestamps
This commit is contained in:
parent
e06cb40dd7
commit
46a20132b0
1 changed files with 7 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
use crate::async_file::{AsyncFile, OpenMode};
|
use crate::async_file::{AsyncFile, OpenMode};
|
||||||
use crate::event::Event;
|
use crate::event::Event;
|
||||||
use crate::setup::{self, input_event};
|
use crate::setup::{self, input_event, timeval};
|
||||||
use std::io::Error;
|
use std::io::Error;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use std::os::unix::io::AsRawFd;
|
use std::os::unix::io::AsRawFd;
|
||||||
|
@ -24,7 +24,12 @@ impl EventWriter {
|
||||||
self.write_raw(event.to_raw()).await
|
self.write_raw(event.to_raw()).await
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) async fn write_raw(&mut self, event: input_event) -> Result<(), Error> {
|
pub(crate) async fn write_raw(&mut self, mut event: input_event) -> Result<(), Error> {
|
||||||
|
event.time = timeval {
|
||||||
|
tv_sec: 0,
|
||||||
|
tv_usec: 0,
|
||||||
|
};
|
||||||
|
|
||||||
let data: [u8; mem::size_of::<input_event>()] = unsafe { mem::transmute(event) };
|
let data: [u8; mem::size_of::<input_event>()] = unsafe { mem::transmute(event) };
|
||||||
self.file.write_all(&data).await
|
self.file.write_all(&data).await
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue