Skip to content

Commit

Permalink
Avoid deprecation warnings
Browse files Browse the repository at this point in the history
These were added in libc 0.28.0; see
rust-lang/libc#1703.
  • Loading branch information
Tamir Duberstein committed Nov 10, 2020
1 parent 5d2a8c2 commit 1da3c3b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/sys/socket/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -847,12 +847,13 @@ impl<'a> ControlMessage<'a> {
}
#[cfg(any(target_os = "android", target_os = "linux"))]
ControlMessage::AlgSetIv(iv) => {
#[allow(deprecated)]
let af_alg_iv = libc::af_alg_iv {
ivlen: iv.len() as u32,
iv: [0u8; 0],
};

let size = mem::size_of::<libc::af_alg_iv>();
let size = mem::size_of_val(&af_alg_iv);

unsafe {
ptr::copy_nonoverlapping(
Expand Down Expand Up @@ -915,7 +916,7 @@ impl<'a> ControlMessage<'a> {
}
#[cfg(any(target_os = "android", target_os = "linux"))]
ControlMessage::AlgSetIv(iv) => {
mem::size_of::<libc::af_alg_iv>() + iv.len()
mem::size_of_val(&iv) + iv.len()
},
#[cfg(any(target_os = "android", target_os = "linux"))]
ControlMessage::AlgSetOp(op) => {
Expand Down

0 comments on commit 1da3c3b

Please sign in to comment.