summaryrefslogtreecommitdiffstats
path: root/vendor/rustix/src/net/send_recv/msg.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/rustix/src/net/send_recv/msg.rs')
-rw-r--r--vendor/rustix/src/net/send_recv/msg.rs12
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