]> git.lizzy.rs Git - rust.git/commitdiff
Fix an endless loop when `getrandom` is not available
authorTobias Bucher <tobiasbucher5991@gmail.com>
Sat, 1 Sep 2018 22:19:11 +0000 (00:19 +0200)
committerTobias Bucher <tobiasbucher5991@gmail.com>
Sat, 1 Sep 2018 22:19:11 +0000 (00:19 +0200)
src/libstd/sys/unix/rand.rs

index 210ace9bbb2268bca701729c3af783a43bb558f5..371e58a20c40dd65a2b182e8aece96079ecfd19e 100644 (file)
@@ -61,6 +61,7 @@ fn getrandom_fill_bytes(v: &mut [u8]) -> bool {
                     continue;
                 } else if err == libc::ENOSYS {
                     GETRANDOM_UNAVAILABLE.store(true, Ordering::Relaxed);
+                    return false;
                 } else if err == libc::EAGAIN {
                     return false;
                 } else {