session: Make sure to mark the socket as CLOEXEC early

This commit is contained in:
Victoria Brekenfeld 2026-03-25 17:13:08 +01:00 committed by Victoria Brekenfeld
parent 4df95190db
commit 769ca13647
2 changed files with 22 additions and 11 deletions

View file

@ -73,7 +73,7 @@ impl State {
// potentially tell the session we are setup now
if let Err(err) =
session::setup_socket(self.common.event_loop_handle.clone(), &self.common)
session::run_socket(self.common.event_loop_handle.clone(), &self.common)
{
warn!(?err, "Failed to setup cosmic-session communication");
}
@ -147,6 +147,11 @@ pub fn run(hooks: crate::hooks::Hooks) -> Result<(), Box<dyn Error>> {
tracy_client::Client::start();
utils::rlimit::increase_nofile_limit();
// This needs to be done before any potential program launches
// (e.g. Xwayland) as it handles passed file descriptors.
if let Err(err) = session::setup_socket() {
warn!("Session error: {:?}", err);
};
// init hook globals
hooks::HOOKS.set(hooks)