Only daemonize on cfg(unix) platforms
This commit is contained in:
parent
0e8fd4eb8c
commit
7b76437224
2 changed files with 4 additions and 1 deletions
|
|
@ -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"]
|
||||
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue