allowing multiple processes to share socket #40

Merged
JakeHillion merged 1 commits from dup-sockets into main 2022-05-19 21:34:22 +01:00
Owner
No description provided.
JakeHillion added a new dependency 2022-05-19 20:18:46 +01:00
JakeHillion reviewed 2022-05-19 20:22:38 +01:00
src/error.rs Outdated
@ -19,3 +19,3 @@
BadPipe(String),
#[error("bad socket specification: a socket must have exactly one reader and one writer: {0}")]
#[error("bad socket specification: a socket must have exactly one reader and one or more writers: {0}")]
Author
Owner

this needs to be reflected in the specification checking

this needs to be reflected in the specification checking
JakeHillion marked this conversation as resolved
src/lib.rs Outdated
@ -180,19 +180,21 @@ impl SocketPair {
Ok(SocketPair {
name: name.to_string(),
read: Some(unsafe { File::from_raw_fd(read) }),
Author
Owner

add more local safety comments

add more local safety comments
JakeHillion marked this conversation as resolved
src/lib.rs Outdated
@ -197,0 +194,4 @@
let dup_fd = nix::unistd::dup(self.write.as_raw_fd())
.map_err(|e| Error::Nix { msg: "dup", src: e })?;
// SAFETY: fuck knows mate
Author
Owner

fix this comment

fix this comment
JakeHillion marked this conversation as resolved
JakeHillion force-pushed dup-sockets from f35e9a2ff9 to 01f8f096c6 2022-05-19 20:31:15 +01:00 Compare
Author
Owner

lgtm

lgtm
JakeHillion merged commit 01f8f096c6 into main 2022-05-19 21:34:22 +01:00
JakeHillion deleted branch dup-sockets 2022-05-19 21:34:39 +01:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Blocks
Reference: JakeHillion/clone-shim#40
No description provided.