main: Increase soft file limit

This commit is contained in:
Victoria Brekenfeld 2024-04-03 18:08:43 +02:00 committed by Victoria Brekenfeld
parent fa7926f7c1
commit 6ba7242cfc
6 changed files with 60 additions and 21 deletions

View file

@ -9,7 +9,7 @@ use smithay::{
};
use anyhow::{Context, Result};
use std::{env, ffi::OsString, process, sync::Arc};
use std::{env, ffi::OsString, os::unix::process::CommandExt, process, sync::Arc};
use tracing::{error, info, warn};
use crate::{
@ -44,6 +44,8 @@ fn main() -> Result<()> {
logger::init_logger()?;
info!("Cosmic starting up!");
utils::rlimit::increase_nofile_limit();
// init event loop
let mut event_loop = EventLoop::try_new().with_context(|| "Failed to initialize event loop")?;
// init wayland
@ -71,6 +73,8 @@ fn main() -> Result<()> {
let mut command = process::Command::new(&exec);
command.args(args);
command.envs(session::get_env(&state)?);
unsafe { command.pre_exec(|| Ok(utils::rlimit::restore_nofile_limit())) };
info!("Running {:?}", exec);
Some(command.spawn()?)
} else {