Skip to content

Commit 062cc24

Browse files
committed
Replace constant with variable
1 parent 6eafb00 commit 062cc24

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/use_file.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fn get_rng_fd() -> Result<libc::c_int, Error> {
3838
#[cold]
3939
fn init_or_wait_fd() -> Result<libc::c_int, Error> {
4040
// Maximum sleep time (~268 milliseconds)
41-
const MAX_SLEEP_NS: libc::c_long = 1 << 28;
41+
let max_sleep_ns = 1 << 28;
4242
// Starting sleep time (~4 microseconds)
4343
let mut timeout_ns = 1 << 12;
4444
loop {
@@ -56,7 +56,7 @@ fn get_rng_fd() -> Result<libc::c_int, Error> {
5656
unsafe {
5757
libc::nanosleep(&rqtp, &mut rmtp);
5858
}
59-
if timeout_ns < MAX_SLEEP_NS {
59+
if timeout_ns < max_sleep_ns {
6060
timeout_ns *= 2;
6161
}
6262
continue;

0 commit comments

Comments
 (0)