Skip to content

Commit

Permalink
Only daemonize on cfg(unix) platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
jackpot51 committed Nov 28, 2023
1 parent 0e8fd4e commit 7b76437
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"]

Expand Down
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ lazy_static::lazy_static! {
}

fn main() -> Result<(), Box<dyn std::error::Error>> {
#[cfg(unix)]
match fork::daemon(true, true) {
Ok(fork::Fork::Child) => (),
Ok(fork::Fork::Parent(_child_pid)) => process::exit(0),
Expand Down

0 comments on commit 7b76437

Please sign in to comment.