diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:44 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:44 +0000 |
commit | c23a457e72abe608715ac76f076f47dc42af07a5 (patch) | |
tree | 2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /vendor/rustix/src/net/send_recv | |
parent | Releasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip |
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/rustix/src/net/send_recv')
-rw-r--r-- | vendor/rustix/src/net/send_recv/msg.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/vendor/rustix/src/net/send_recv/msg.rs b/vendor/rustix/src/net/send_recv/msg.rs index 5fefb2e24..431aefa03 100644 --- a/vendor/rustix/src/net/send_recv/msg.rs +++ b/vendor/rustix/src/net/send_recv/msg.rs @@ -107,8 +107,8 @@ impl<'buf, 'slice, 'fd> SendAncillaryBuffer<'buf, 'slice, 'fd> { /// Returns a pointer to the message data. pub(crate) fn as_control_ptr(&mut self) -> *mut u8 { - // When the length is zero, we may be using a `&[]` address, which - // may be an invalid but non-null pointer, and on some platforms, that + // When the length is zero, we may be using a `&[]` address, which may + // be an invalid but non-null pointer, and on some platforms, that // causes `sendmsg` to fail with `EFAULT` or `EINVAL` #[cfg(not(linux_kernel))] if self.length == 0 { @@ -227,8 +227,8 @@ impl<'buf> RecvAncillaryBuffer<'buf> { /// Returns a pointer to the message data. pub(crate) fn as_control_ptr(&mut self) -> *mut u8 { - // When the length is zero, we may be using a `&[]` address, which - // may be an invalid but non-null pointer, and on some platforms, that + // When the length is zero, we may be using a `&[]` address, which may + // be an invalid but non-null pointer, and on some platforms, that // causes `sendmsg` to fail with `EFAULT` or `EINVAL` #[cfg(not(linux_kernel))] if self.buffer.is_empty() { @@ -686,9 +686,9 @@ impl<T> DoubleEndedIterator for AncillaryIter<'_, T> { mod messages { use crate::backend::c; + use crate::backend::net::msghdr; use core::iter::FusedIterator; use core::marker::PhantomData; - use core::mem::zeroed; use core::ptr::NonNull; /// An iterator over the messages in an ancillary buffer. @@ -709,7 +709,7 @@ mod messages { /// Create a new iterator over messages from a byte buffer. pub(super) fn new(buf: &'buf mut [u8]) -> Self { let msghdr = { - let mut h: c::msghdr = unsafe { zeroed() }; + let mut h = msghdr::zero_msghdr(); h.msg_control = buf.as_mut_ptr().cast(); h.msg_controllen = buf.len().try_into().expect("buffer too large for msghdr"); h |