Skip to content

Commit eb627ea

Browse files
committed
kmc-solid: Refactor is_interrupted to avoid integer overflow
1 parent dc37959 commit eb627ea

File tree

1 file changed

+1
-2
lines changed
  • library/std/src/sys/solid

1 file changed

+1
-2
lines changed

library/std/src/sys/solid/net.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,7 @@ pub(super) fn error_name(er: abi::ER) -> Option<&'static str> {
183183

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

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

0 commit comments

Comments
 (0)