We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6eafb00 commit 062cc24Copy full SHA for 062cc24
src/use_file.rs
@@ -38,7 +38,7 @@ fn get_rng_fd() -> Result<libc::c_int, Error> {
38
#[cold]
39
fn init_or_wait_fd() -> Result<libc::c_int, Error> {
40
// Maximum sleep time (~268 milliseconds)
41
- const MAX_SLEEP_NS: libc::c_long = 1 << 28;
+ let max_sleep_ns = 1 << 28;
42
// Starting sleep time (~4 microseconds)
43
let mut timeout_ns = 1 << 12;
44
loop {
@@ -56,7 +56,7 @@ fn get_rng_fd() -> Result<libc::c_int, Error> {
56
unsafe {
57
libc::nanosleep(&rqtp, &mut rmtp);
58
}
59
- if timeout_ns < MAX_SLEEP_NS {
+ if timeout_ns < max_sleep_ns {
60
timeout_ns *= 2;
61
62
continue;
0 commit comments