From 9ce20b5ddb4ea3a7a53fee610d7694823f0eaf1e Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 23 Dec 2020 01:35:48 +0000 Subject: [PATCH] cleanup notify - not working I think I am bollixing up Command's own pipe with my pipe in the pre-exec hook Signed-off-by: Ian Jackson --- wdriver.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/wdriver.rs b/wdriver.rs index 6baf13e6..5a792aa2 100644 --- a/wdriver.rs +++ b/wdriver.rs @@ -48,9 +48,9 @@ mod cleanup_notify { pub struct Handle(RawFd); - #[throws(AE)] + #[throws(io::Error)] fn mkpipe() -> (RawFd,RawFd) { - pipe2(OFlag::O_CLOEXEC)? + pipe2(OFlag::O_CLOEXEC).map_err(nix2io)? } #[throws(io::Error)] @@ -83,14 +83,12 @@ mod cleanup_notify { pub fn arm_hook(&self, cmd: &mut Command) { unsafe { use std::os::unix::process::CommandExt; - let (reading_end, writing_end) = mkpipe() - .context("create permission to carry on pipe")?; - let notify_writing_end = self.0; let all_signals = nix::sys::signal::SigSet::all(); cmd.pre_exec(move || -> Result<(), io::Error> { let semidaemon = nix::unistd::getpid(); + let (reading_end, writing_end) = mkpipe()?; match fork().map_err(nix2io)? { ForkResult::Child => { -- 2.30.2