kmc-solid: Refactor is_interrupted
to avoid integer overflow
This commit is contained in:
parent
dc37959ce8
commit
eb627ea339
1 changed files with 1 additions and 2 deletions
|
@ -183,8 +183,7 @@ pub(super) fn error_name(er: abi::ER) -> Option<&'static str> {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn is_interrupted(er: abi::ER) -> bool {
|
pub fn is_interrupted(er: abi::ER) -> bool {
|
||||||
let errno = netc::SOLID_NET_ERR_BASE - er;
|
er == netc::SOLID_NET_ERR_BASE - libc::EINTR
|
||||||
errno as libc::c_int == libc::EINTR
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(super) fn decode_error_kind(er: abi::ER) -> ErrorKind {
|
pub(super) fn decode_error_kind(er: abi::ER) -> ErrorKind {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue