From 0a6ed63f3e882ab4c7f4befb3126e1d3e3f9389c Mon Sep 17 00:00:00 2001 From: Akhil T Thomas Date: Mon, 1 Apr 2024 16:39:50 +0200 Subject: [PATCH] [review fix] clippy + missing FD_CLOEXEC Signed-off-by: Akhil T Thomas --- src/sys/unix/uds/mod.rs | 2 +- tests/tcp.rs | 2 +- tests/unix_pipe.rs | 15 ++++++++++++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/sys/unix/uds/mod.rs b/src/sys/unix/uds/mod.rs index 99dd28d2c..20367fd09 100644 --- a/src/sys/unix/uds/mod.rs +++ b/src/sys/unix/uds/mod.rs @@ -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))?; } diff --git a/tests/tcp.rs b/tests/tcp.rs index 2e0046d9a..49e731936 100644 --- a/tests/tcp.rs +++ b/tests/tcp.rs @@ -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 { diff --git a/tests/unix_pipe.rs b/tests/unix_pipe.rs index be55cfba6..dc79026c4 100644 --- a/tests/unix_pipe.rs +++ b/tests/unix_pipe.rs @@ -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); @@ -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); @@ -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")