diff --git a/src/intercept_conf.rs b/src/intercept_conf.rs index 6ec5eee0..f705bf29 100755 --- a/src/intercept_conf.rs +++ b/src/intercept_conf.rs @@ -111,15 +111,6 @@ impl InterceptConf { }; format!("{}{}", start, parts.join(" or ")) } - - // pub fn serialize(&self) -> Vec { - // let mut buf = Vec::new(); - // let ipc = ipc::InterceptConf{pids: Vec::new(), process_names: self.process_names.clone(), invert: self.invert}; - // buf.reserve(ipc.encoded_len()); - // // Unwrap is safe, since we have reserved sufficient capacity in the vector. - // ipc.encode(&mut buf).unwrap(); - // buf - // } } #[cfg(test)] diff --git a/src/packet_sources/macos.rs b/src/packet_sources/macos.rs index 9a983986..4328e617 100644 --- a/src/packet_sources/macos.rs +++ b/src/packet_sources/macos.rs @@ -61,21 +61,18 @@ impl PipeServer { fn create_pipe(path: &PathBuf) -> Result<(pipe::Receiver, pipe::Sender)> { if !path.exists() { - match mkfifo(path, Mode::S_IRWXU) { - Ok(_) => println!("created {:?}", path), - Err(e) => Err(anyhow!("Failed to create fifo: {:?}", e))?, - } + mkfifo(path, Mode::S_IRWXU)?; } let rx = match pipe::OpenOptions::new() .unchecked(true) - .open_receiver(&path) + .open_receiver(path) { Ok(rx) => rx, Err(e) => Err(anyhow!("Failed to open fifo receiver: {:?}", e))?, }; - let tx = match pipe::OpenOptions::new().unchecked(true).open_sender(&path) { + let tx = match pipe::OpenOptions::new().unchecked(true).open_sender(path) { Ok(tx) => tx, - Err(e) => Err(anyhow!("Failed to open fifo receiver: {:?}", e))?, + Err(e) => Err(anyhow!("Failed to open fifo transmitter: {:?}", e))?, }; Ok((rx, tx))