Skip to content

Commit 32969e5

Browse files
dignifiedquireThomasdezeeuw
authored andcommitted
fix: unify sigpipe settings for macos and ios
Closes #83
1 parent b3badc7 commit 32969e5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sys/unix.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ impl Socket {
261261
let fd = syscall!(socket(family, ty, protocol))?;
262262
let fd = unsafe { Socket::from_raw_fd(fd) };
263263
set_cloexec(fd.as_raw_fd())?;
264-
#[cfg(target_os = "macos")]
264+
#[cfg(any(target_os = "macos", target_os = "ios"))]
265265
unsafe {
266266
fd.setsockopt(libc::SOL_SOCKET, libc::SO_NOSIGPIPE, 1i32)?;
267267
}
@@ -274,7 +274,7 @@ impl Socket {
274274
let fds = unsafe { (Socket::from_raw_fd(fds[0]), Socket::from_raw_fd(fds[1])) };
275275
set_cloexec(fds.0.as_raw_fd())?;
276276
set_cloexec(fds.1.as_raw_fd())?;
277-
#[cfg(target_os = "macos")]
277+
#[cfg(any(target_os = "macos", target_os = "ios"))]
278278
unsafe {
279279
fds.0
280280
.setsockopt(libc::SOL_SOCKET, libc::SO_NOSIGPIPE, 1i32)?;

0 commit comments

Comments
 (0)