Fix build failure on ARM/AArch64/PowerPC/RISC-V FreeBSD/NetBSD

This commit is contained in:
Taiki Endo 2024-03-24 17:26:48 +09:00
parent 548e14b439
commit 7aa76a7ac3

View File

@ -459,7 +459,7 @@ impl Socket {
const AF_NAME_MAX: usize = 16; const AF_NAME_MAX: usize = 16;
let mut buf = [0; AF_NAME_MAX]; let mut buf = [0; AF_NAME_MAX];
for (src, dst) in name.to_bytes().iter().zip(&mut buf[..AF_NAME_MAX - 1]) { for (src, dst) in name.to_bytes().iter().zip(&mut buf[..AF_NAME_MAX - 1]) {
*dst = *src as i8; *dst = *src as libc::c_char;
} }
let mut arg: libc::accept_filter_arg = unsafe { mem::zeroed() }; let mut arg: libc::accept_filter_arg = unsafe { mem::zeroed() };
arg.af_name = buf; arg.af_name = buf;