From 7b76437224679a0c93939212c2ff9797b6d87520 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Tue, 28 Nov 2023 12:03:30 -0700 Subject: [PATCH] Only daemonize on cfg(unix) platforms --- Cargo.toml | 4 +++- src/main.rs | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index cf2d113..97e52a0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,6 @@ license = "GPL-3.0-only" [dependencies] env_logger = "0.10.0" -fork = "0.1" lazy_static = "1.4.0" log = "0.4.20" notify = "6.1.1" @@ -38,6 +37,9 @@ features = ["tokio", "winit", "wgpu"] [dependencies.systemicons] git = "https://github.com/jackpot51/systemicons" +[target.'cfg(unix)'.dependencies] +fork = "0.1" + [features] default = ["rfd"] diff --git a/src/main.rs b/src/main.rs index 81863ee..0052702 100644 --- a/src/main.rs +++ b/src/main.rs @@ -60,6 +60,7 @@ lazy_static::lazy_static! { } fn main() -> Result<(), Box> { + #[cfg(unix)] match fork::daemon(true, true) { Ok(fork::Fork::Child) => (), Ok(fork::Fork::Parent(_child_pid)) => process::exit(0),