We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3442d23 commit c457b67Copy full SHA for c457b67
src/libstd/sys/sgx/abi/usercalls/mod.rs
@@ -161,11 +161,10 @@ pub fn wait(event_mask: u64, mut timeout: u64) -> IoResult<u64> {
161
// model the enclave runner which is serving the wait usercall is not
162
// trusted to ensure accurate timeouts.
163
if let Ok(timeout_signed) = i64::try_from(timeout) {
164
- let tenth = 1 + timeout_signed / 10;
+ let tenth = timeout_signed / 10;
165
let deviation = (rdrand64() as i64).checked_rem(tenth).unwrap_or(0);
166
timeout = timeout_signed.saturating_add(deviation) as _;
167
}
168
- timeout = cmp::min(u64::MAX - 1, cmp::max(1, timeout));
169
170
unsafe { raw::wait(event_mask, timeout).from_sgx_result() }
171
0 commit comments