Skip to content

Commit

Permalink
[review fix] clippy + missing FD_CLOEXEC
Browse files Browse the repository at this point in the history
Signed-off-by: Akhil T Thomas <akhilthomasmec@gmail.com>
  • Loading branch information
AkhilTThomas committed Apr 1, 2024
1 parent 81a6eee commit 0a6ed63
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/sys/unix/uds/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ cfg_os_poll! {
#[cfg(not(any(target_os = "espidf", target_os = "vita", target_os = "nto")))]
syscall!(fcntl(fds[0], libc::F_SETFD, libc::FD_CLOEXEC))?;
syscall!(fcntl(fds[1], libc::F_SETFL, libc::O_NONBLOCK))?;
#[cfg(not(any(target_os = "espidf", target_os = "vita")))]
#[cfg(not(any(target_os = "espidf", target_os = "vita", target_os = "nto")))]
syscall!(fcntl(fds[1], libc::F_SETFD, libc::FD_CLOEXEC))?;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ fn write_shutdown() {
// Now, shutdown the write half of the socket.
socket.shutdown(Shutdown::Write).unwrap();

// POLLRDHUP isn't supported on Solaris,
// POLLRDHUP isn't supported on Solaris,
if cfg!(any(target_os = "solaris", target_os = "nto")) {
wait!(poll, is_readable, false);
} else {
Expand Down
15 changes: 12 additions & 3 deletions tests/unix_pipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ fn smoke() {
}

#[test]
#[cfg_attr(target_os = "nto", ignore = "Writer fd close events do not trigger POLLHUP on nto target")]
#[cfg_attr(
target_os = "nto",
ignore = "Writer fd close events do not trigger POLLHUP on nto target"
)]
fn event_when_sender_is_dropped() {
let mut poll = Poll::new().unwrap();
let mut events = Events::with_capacity(8);
Expand Down Expand Up @@ -92,7 +95,10 @@ fn event_when_sender_is_dropped() {
}

#[test]
#[cfg_attr(target_os = "nto", ignore = "Read fd close events do not trigger POLLHUP on nto target")]
#[cfg_attr(
target_os = "nto",
ignore = "Read fd close events do not trigger POLLHUP on nto target"
)]
fn event_when_receiver_is_dropped() {
let mut poll = Poll::new().unwrap();
let mut events = Events::with_capacity(8);
Expand Down Expand Up @@ -126,7 +132,10 @@ fn event_when_receiver_is_dropped() {
}

#[test]
#[cfg_attr(target_os = "nto", ignore = "Read/Write close eventsdo not trigger POLLHUP on nto target")]
#[cfg_attr(
target_os = "nto",
ignore = "Read/Write close eventsdo not trigger POLLHUP on nto target"
)]
fn from_child_process_io() {
// `cat` simply echo everything that we write via standard in.
let mut child = Command::new("cat")
Expand Down

0 comments on commit 0a6ed63

Please sign in to comment.