Skip to content

Commit

Permalink
fixup: OsStrExt
Browse files Browse the repository at this point in the history
  • Loading branch information
hulthe committed Nov 22, 2024
1 parent 9212170 commit 241a3d0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mullvad-daemon/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,10 @@ fn init_early_boot_logging(config: &cli::Config) {
fn init_logger(config: &cli::Config, log_file: Option<PathBuf>) -> Result<(), String> {
#[cfg(unix)]
if let Some(log_file) = &log_file {
use std::os::unix::ffi::OsStrExt;

exception_logging::set_log_file(
std::ffi::CString::new(log_file.as_os_str().as_encoded_bytes())
std::ffi::CString::new(log_file.as_os_str().as_bytes())
.map_err(|_| "Log file path contains null-bytes".to_string())?,
);
}
Expand Down

0 comments on commit 241a3d0

Please sign in to comment.