Skip to content

Commit 387068f

Browse files
committed
Do not assume glibc version of msghdr
The msghdr struct definition varies between glibc and musl. Fix the usage of the struct in the code to make it compatible with both. Signed-off-by: Jens Reidel <[email protected]>
1 parent 7c1e947 commit 387068f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/io/sendmsg.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ impl<T: BoundedBuf, U: BoundedBuf> Op<SendMsg<T, U>> {
5555
match msg_control {
5656
Some(ref _msg_control) => {
5757
msghdr.msg_control = _msg_control.stable_ptr() as *mut _;
58-
msghdr.msg_controllen = _msg_control.bytes_init();
58+
msghdr.msg_controllen = _msg_control.bytes_init() as _;
5959
}
6060
None => {
6161
msghdr.msg_control = std::ptr::null_mut();
62-
msghdr.msg_controllen = 0_usize;
62+
msghdr.msg_controllen = 0;
6363
}
6464
}
6565

src/io/sendmsg_zc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ impl<T: BoundedBuf, U: BoundedBuf> Op<SendMsgZc<T, U>, MultiCQEFuture> {
6262
match msg_control {
6363
Some(ref _msg_control) => {
6464
msghdr.msg_control = _msg_control.stable_ptr() as *mut _;
65-
msghdr.msg_controllen = _msg_control.bytes_init();
65+
msghdr.msg_controllen = _msg_control.bytes_init() as _;
6666
}
6767
None => {
6868
msghdr.msg_control = std::ptr::null_mut();
69-
msghdr.msg_controllen = 0_usize;
69+
msghdr.msg_controllen = 0;
7070
}
7171
}
7272

0 commit comments

Comments
 (0)