Skip to content

Commit 377aa76

Browse files
committed
Attempt to fix up SGX for random API updates
1 parent 900aa00 commit 377aa76

File tree

1 file changed

+2
-2
lines changed
  • library/std/src/sys/pal/sgx/abi/usercalls

1 file changed

+2
-2
lines changed

library/std/src/sys/pal/sgx/abi/usercalls/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::cmp;
22
use crate::io::{
33
BorrowedCursor, Error as IoError, ErrorKind, IoSlice, IoSliceMut, Result as IoResult,
44
};
5-
use crate::random::{DefaultRandomSource, Random};
5+
use crate::random::random;
66
use crate::time::{Duration, Instant};
77

88
pub(crate) mod alloc;
@@ -179,7 +179,7 @@ pub fn wait(event_mask: u64, mut timeout: u64) -> IoResult<u64> {
179179
// trusted to ensure accurate timeouts.
180180
if let Ok(timeout_signed) = i64::try_from(timeout) {
181181
let tenth = timeout_signed / 10;
182-
let deviation = i64::random(&mut DefaultRandomSource).checked_rem(tenth).unwrap_or(0);
182+
let deviation = random::<i64>(..).checked_rem(tenth).unwrap_or(0);
183183
timeout = timeout_signed.saturating_add(deviation) as _;
184184
}
185185
}

0 commit comments

Comments
 (0)