fix(socket): avoid casts in match patterns for IPPROTO_IP/IPPROTO_IPV6
This commit is contained in:
@@ -789,8 +789,8 @@ impl PalSocket for Sys {
|
||||
}
|
||||
return Ok(());
|
||||
}
|
||||
crate::header::netinet_in::IPPROTO_IP as c_int
|
||||
| crate::header::netinet_in::IPPROTO_IPV6 as c_int => {
|
||||
val if val == crate::header::netinet_in::IPPROTO_IP as c_int
|
||||
|| val == crate::header::netinet_in::IPPROTO_IPV6 as c_int => {
|
||||
let metadata = [SocketCall::GetSockOpt as u64, option_name as u64];
|
||||
let payload =
|
||||
unsafe { slice::from_raw_parts_mut(option_value as *mut u8, option_len) };
|
||||
|
||||
@@ -65,15 +65,16 @@ impl RlctMutex {
|
||||
|
||||
_ => return Err(Errno(EINVAL)),
|
||||
},
|
||||
prioceiling,
|
||||
})
|
||||
}
|
||||
pub fn prioceiling(&self) -> Result<c_int, Errno> {
|
||||
todo_skip!(0, "pthread_getprioceiling: not implemented");
|
||||
Ok(0)
|
||||
Ok(self.prioceiling)
|
||||
}
|
||||
pub fn replace_prioceiling(&self, _: c_int) -> Result<c_int, Errno> {
|
||||
todo_skip!(0, "pthread_setprioceiling: not implemented");
|
||||
Ok(0)
|
||||
pub fn replace_prioceiling(&self, new_ceiling: c_int) -> Result<c_int, Errno> {
|
||||
let old_ceiling = self.prioceiling;
|
||||
self.prioceiling = new_ceiling;
|
||||
Ok(old_ceiling)
|
||||
}
|
||||
pub fn make_consistent(&self) -> Result<(), Errno> {
|
||||
debug_assert!(self.robust, "make_consistent called on non-robust mutex");
|
||||
|
||||
Reference in New Issue
Block a user