Skip to content

Commit

Permalink
Fix cmsg_len() return type on OpenHarmony (#2456)
Browse files Browse the repository at this point in the history
  • Loading branch information
jschwe authored Jun 26, 2024
1 parent ab45051 commit 0f53575
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog/2456.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix cmsg_len() return type on OpenHarmony
4 changes: 2 additions & 2 deletions src/sys/socket/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1169,13 +1169,13 @@ impl<'a> ControlMessage<'a> {
/// The value of CMSG_LEN on this message.
/// Safe because CMSG_LEN is always safe
#[cfg(any(target_os = "android",
all(target_os = "linux", not(target_env = "musl"))))]
all(target_os = "linux", not(any(target_env = "musl", target_env = "ohos")))))]
fn cmsg_len(&self) -> usize {
unsafe{CMSG_LEN(self.len() as libc::c_uint) as usize}
}

#[cfg(not(any(target_os = "android",
all(target_os = "linux", not(target_env = "musl")))))]
all(target_os = "linux", not(any(target_env = "musl", target_env = "ohos"))))))]
fn cmsg_len(&self) -> libc::c_uint {
unsafe{CMSG_LEN(self.len() as libc::c_uint)}
}
Expand Down

0 comments on commit 0f53575

Please sign in to comment.