mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-04 19:12:50 +00:00
Add comment for the previous android bug fix
This commit is contained in:
parent
9b9dd4aeea
commit
8983752c12
@ -160,6 +160,8 @@ fn add_to_ancillary_data<T>(
|
|||||||
previous_cmsg = cmsg;
|
previous_cmsg = cmsg;
|
||||||
cmsg = libc::CMSG_NXTHDR(&msg, cmsg);
|
cmsg = libc::CMSG_NXTHDR(&msg, cmsg);
|
||||||
cfg_if::cfg_if! {
|
cfg_if::cfg_if! {
|
||||||
|
// Android return the same pointer if it is the last cmsg.
|
||||||
|
// Therefore, check it if the previous pointer is the same as the current one.
|
||||||
if #[cfg(target_os = "android")] {
|
if #[cfg(target_os = "android")] {
|
||||||
if cmsg == previous_cmsg {
|
if cmsg == previous_cmsg {
|
||||||
break;
|
break;
|
||||||
@ -430,6 +432,8 @@ impl<'a> Iterator for Messages<'a> {
|
|||||||
|
|
||||||
let cmsg = cmsg.as_ref()?;
|
let cmsg = cmsg.as_ref()?;
|
||||||
cfg_if::cfg_if! {
|
cfg_if::cfg_if! {
|
||||||
|
// Android return the same pointer if it is the last cmsg.
|
||||||
|
// Therefore, check it if the previous pointer is the same as the current one.
|
||||||
if #[cfg(target_os = "android")] {
|
if #[cfg(target_os = "android")] {
|
||||||
if let Some(current) = self.current {
|
if let Some(current) = self.current {
|
||||||
if eq(current, cmsg) {
|
if eq(current, cmsg) {
|
||||||
|
Loading…
Reference in New Issue
Block a user