From d8d73ba8e11ba7d886ddb98f697359643cc24336 Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Sat, 7 Mar 2026 14:08:06 +0100 Subject: [PATCH] state: store compositor pid --- src/compositor.rs | 4 +++- src/state.rs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/compositor.rs b/src/compositor.rs index 332fb92a..27a96be2 100644 --- a/src/compositor.rs +++ b/src/compositor.rs @@ -199,7 +199,8 @@ fn start_compositor2( test_future: Option, caps_thread: Option, ) -> Result<(), CompositorError> { - log::info!("pid = {}", uapi::getpid()); + let pid = uapi::getpid(); + log::info!("pid = {pid}"); log::info!("version = {VERSION}"); if did_elevate_scheduler() { log::info!("Running with elevated scheduler: SCHED_RR"); @@ -224,6 +225,7 @@ fn start_compositor2( let crit_ids = Rc::new(CritMatcherIds::default()); let eventfd_cache = EventfdCache::new(&ring, &engine); let state = Rc::new(State { + pid, kb_ctx, backend: CloneCell::new(Rc::new(DummyBackend)), forker: Default::default(), diff --git a/src/state.rs b/src/state.rs index 192e47f1..2d624d5b 100644 --- a/src/state.rs +++ b/src/state.rs @@ -145,10 +145,12 @@ use { time::Duration, }, thiserror::Error, - uapi::OwnedFd, + uapi::{OwnedFd, c}, }; pub struct State { + #[expect(dead_code)] + pub pid: c::pid_t, pub kb_ctx: KbvmContext, pub backend: CloneCell>, pub forker: CloneCell>>,