Only daemonize on cfg(unix) platforms

This commit is contained in:
Jeremy Soller 2023-11-28 12:03:30 -07:00
parent 0e8fd4eb8c
commit 7b76437224
No known key found for this signature in database
GPG key ID: DCFCA852D3906975
2 changed files with 4 additions and 1 deletions

View file

@ -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),