From 744903f8742458ccb458591bf4cdd0ee39b623b9 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Mon, 1 Jul 2019 10:39:13 +0200 Subject: [PATCH] daemon: remove last use of tools::read/write Signed-off-by: Wolfgang Bumiller --- src/tools/daemon.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tools/daemon.rs b/src/tools/daemon.rs index af71828b..ae54570b 100644 --- a/src/tools/daemon.rs +++ b/src/tools/daemon.rs @@ -9,10 +9,10 @@ use std::panic::UnwindSafe; use failure::*; use tokio::prelude::*; +use proxmox::tools::io::{ReadExt, WriteExt}; + use crate::server; use crate::tools::{fd_change_cloexec, self}; -use crate::tools::read::*; -use crate::tools::write::*; // Unfortunately FnBox is nightly-only and Box is unusable, so just use Box... pub type BoxedStoreFunc = Box Result + UnwindSafe + Send>; @@ -106,7 +106,7 @@ impl Reloader { std::fs::File::from_raw_fd(pout.into_raw_fd()) }; let pid = nix::unistd::Pid::this(); - if let Err(e) = pout.write_value(&pid.as_raw()) { + if let Err(e) = unsafe { pout.write_host_value(pid.as_raw()) } { log::error!("failed to send new server PID to parent: {}", e); unsafe { libc::_exit(-1); @@ -137,7 +137,7 @@ impl Reloader { let mut pin = unsafe { std::fs::File::from_raw_fd(pin.into_raw_fd()) }; - let child = nix::unistd::Pid::from_raw(match pin.read_value() { + let child = nix::unistd::Pid::from_raw(match unsafe { pin.read_le_value() } { Ok(v) => v, Err(e) => { log::error!("failed to receive pid of double-forked child process: {}", e);