Only daemonize on cfg(unix) platforms
This commit is contained in:
parent
0e8fd4eb8c
commit
7b76437224
2 changed files with 4 additions and 1 deletions
|
|
@ -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