There should no longer be any - read - write - connect - sendmsg - recvmsg - accept calls in the codebase. Previously we were using a mix of io_uring and these calls which had some negative effects: Since we were using the old system calls, we had to set the file descriptors to non-blocking. But our io_uring code did not handle EAGAIN. This lead to programs sometimes being killed when the wayland IO was actually blocking. Now all file descriptors are set to blocking, but io_uring makes it non-blocking from our perspective. The one exception are evdev files because they are read via libinput and libinput uses the old system calls.
33 lines
715 B
Rust
33 lines
715 B
Rust
use {
|
|
crate::{
|
|
cli::{GlobalArgs, SetLogArgs},
|
|
tools::tool_client::{with_tool_client, ToolClient},
|
|
wire::jay_compositor::SetLogLevel,
|
|
},
|
|
std::rc::Rc,
|
|
};
|
|
|
|
pub fn main(global: GlobalArgs, args: SetLogArgs) {
|
|
with_tool_client(global.log_level.into(), |tc| async move {
|
|
let logger = Rc::new(Log {
|
|
tc: tc.clone(),
|
|
args,
|
|
});
|
|
run(logger).await;
|
|
});
|
|
}
|
|
|
|
struct Log {
|
|
tc: Rc<ToolClient>,
|
|
args: SetLogArgs,
|
|
}
|
|
|
|
async fn run(log: Rc<Log>) {
|
|
let tc = &log.tc;
|
|
let comp = tc.jay_compositor().await;
|
|
tc.send(SetLogLevel {
|
|
self_id: comp,
|
|
level: log.args.level as u32,
|
|
});
|
|
tc.round_trip().await;
|
|
}
|