Skip to content

Commit

Permalink
Detach daemon on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
MolotovCherry committed Sep 4, 2024
1 parent e34c022 commit 86be18f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pueue/src/bin/pueued.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,17 @@ fn fork_daemon(opt: &CliArguments) -> Result<()> {
"pueued".to_string()
};

Command::new(current_exe)
let mut command = Command::new(current_exe);

#[cfg(target_os = "windows")]
{
use std::os::windows::process::CommandExt;
const DETACHED_PROCESS: u32 = 0x00000008;

command.creation_flags(DETACHED_PROCESS);
}

command
.args(&arguments)
.spawn()
.expect("Failed to fork new process.");
Expand Down

0 comments on commit 86be18f

Please sign in to comment.