daemonize: switch the pid and log file arguments

The caller and the definition had them swapped.. So it was logging to
the PID file and writing the PID to the log file..
This commit is contained in:
Antoine Poinsot 2023-02-13 10:56:22 +01:00
parent e4d4fcd9fc
commit f10c35e964
No known key found for this signature in database
GPG Key ID: E13FC145CD3F4304

View File

@ -10,8 +10,8 @@ use std::path::Path;
// MIT licensed according to https://github.com/jedisct1/rust-daemonize-simple/blob/master/Cargo.toml
pub unsafe fn daemonize(
chdir: &Path,
pid_file: &Path,
log_file: &Path,
pid_file: &Path,
) -> Result<(), &'static str> {
match libc::fork() {
-1 => return Err("fork() failed"),