Skip to content

Commit

Permalink
Close-on-exec by default for received fds
Browse files Browse the repository at this point in the history
  • Loading branch information
FuuuOverclocking authored Oct 9, 2024
1 parent 69994c1 commit f3487c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ fn recv_with_fd(socket: RawFd, bs: &mut [u8], mut fds: &mut [RawFd]) -> io::Resu
};
let (mut msghdr, cmsg_layout, _) = construct_msghdr_for(&mut iov, fds.len());
let cmsg_buffer = msghdr.msg_control;
let count = libc::recvmsg(socket, &mut msghdr as *mut _, 0);
let count = libc::recvmsg(socket, &mut msghdr as *mut _, libc::MSG_CMSG_CLOEXEC);

Check failure on line 126 in src/lib.rs

View workflow job for this annotation

GitHub Actions / cross-ios-build (stable, aarch64-apple-ios)

cannot find value `MSG_CMSG_CLOEXEC` in crate `libc`

Check failure on line 126 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, macOS-latest)

cannot find value `MSG_CMSG_CLOEXEC` in crate `libc`

Check failure on line 126 in src/lib.rs

View workflow job for this annotation

GitHub Actions / cross-ios-build (stable, x86_64-apple-ios)

cannot find value `MSG_CMSG_CLOEXEC` in crate `libc`

Check failure on line 126 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, macOS-latest, --all-features --release)

cannot find value `MSG_CMSG_CLOEXEC` in crate `libc`

Check failure on line 126 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, macOS-latest, --all-features)

cannot find value `MSG_CMSG_CLOEXEC` in crate `libc`

Check failure on line 126 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, macOS-latest)

cannot find value `MSG_CMSG_CLOEXEC` in crate `libc`

Check failure on line 126 in src/lib.rs

View workflow job for this annotation

GitHub Actions / cross-ios-build (nightly, x86_64-apple-ios)

cannot find value `MSG_CMSG_CLOEXEC` in crate `libc`

Check failure on line 126 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (stable, macOS-latest, --all-features)

cannot find value `MSG_CMSG_CLOEXEC` in crate `libc`

Check failure on line 126 in src/lib.rs

View workflow job for this annotation

GitHub Actions / native-test (nightly, macOS-latest, --all-features --release)

cannot find value `MSG_CMSG_CLOEXEC` in crate `libc`

Check failure on line 126 in src/lib.rs

View workflow job for this annotation

GitHub Actions / cross-ios-build (nightly, aarch64-apple-ios)

cannot find value `MSG_CMSG_CLOEXEC` in crate `libc`
if count < 0 {
let error = io::Error::last_os_error();
alloc::dealloc(cmsg_buffer as *mut _, cmsg_layout);
Expand Down

0 comments on commit f3487c4

Please sign in to comment.