Skip to content

Commit 0f53575

Browse files
authored
Fix cmsg_len() return type on OpenHarmony (#2456)
1 parent ab45051 commit 0f53575

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

changelog/2456.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix cmsg_len() return type on OpenHarmony

src/sys/socket/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,13 +1169,13 @@ impl<'a> ControlMessage<'a> {
11691169
/// The value of CMSG_LEN on this message.
11701170
/// Safe because CMSG_LEN is always safe
11711171
#[cfg(any(target_os = "android",
1172-
all(target_os = "linux", not(target_env = "musl"))))]
1172+
all(target_os = "linux", not(any(target_env = "musl", target_env = "ohos")))))]
11731173
fn cmsg_len(&self) -> usize {
11741174
unsafe{CMSG_LEN(self.len() as libc::c_uint) as usize}
11751175
}
11761176

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

0 commit comments

Comments
 (0)