Skip to content

Commit

Permalink
kmc-solid: Refactor is_interrupted to avoid integer overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kawadakk committed Sep 1, 2023
1 parent dc37959 commit eb627ea
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions library/std/src/sys/solid/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ pub(super) fn error_name(er: abi::ER) -> Option<&'static str> {

#[inline]
pub fn is_interrupted(er: abi::ER) -> bool {
let errno = netc::SOLID_NET_ERR_BASE - er;
errno as libc::c_int == libc::EINTR
er == netc::SOLID_NET_ERR_BASE - libc::EINTR
}

pub(super) fn decode_error_kind(er: abi::ER) -> ErrorKind {
Expand Down

0 comments on commit eb627ea

Please sign in to comment.