From a2f208bc6b4f0880cc67535f836c46b898c0aa95 Mon Sep 17 00:00:00 2001 From: Avril Date: Wed, 25 Aug 2021 23:13:57 +0100 Subject: [PATCH] TODO: Move internal socket ownership and closing logic into a seperate internal struct to handle Drop impl more safely. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fortune for comfork's current commit: Blessing − 吉 --- src/sys/pipe.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sys/pipe.rs b/src/sys/pipe.rs index f528358..5ed27f6 100644 --- a/src/sys/pipe.rs +++ b/src/sys/pipe.rs @@ -19,6 +19,7 @@ pub enum ErrorKind } /// A raw unix pipe +// TODO: Change uses of `i32` for socket fds. Or change this to a struct (see below.) pub type RawPipe = i32; /// Create a raw pipe pair. @@ -33,6 +34,9 @@ pub(crate) fn unix_pipe() -> Result<(i32, i32), Error> } } +//TODO: Factor out the `i32` raw sockets in these types below into a seperate `RawPipe` struct, which has the Drop impl and has functions for transfering ownership of the raw socket (it should hide the raw fd when not explicitly needed ideally.) +// This will prevent us from having to ensure we `forget()` the outer type each time we want to move the inner one around without closing it. + /// A writer for a bi-directinoal unix pipe /// /// Created by splitting `Pipe`, data written to this is available to be read from its `ReadHalf` counterpart.