Skip to content

Commit f0a58de

Browse files
committed
panic in linux_android
1 parent fa6ebd3 commit f0a58de

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/getentropy.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ use core::{ffi::c_void, mem::MaybeUninit};
1313
pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
1414
for chunk in dest.chunks_mut(256) {
1515
let ret = unsafe { libc::getentropy(chunk.as_mut_ptr().cast::<c_void>(), chunk.len()) };
16-
if ret == 42 {
17-
todo!();
18-
}
1916
if ret != 0 {
2017
return Err(last_os_error());
2118
}

src/linux_android.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ compile_error!("`linux_getrandom` backend can be enabled only for Linux/Android
77

88
pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
99
util_libc::sys_fill_exact(dest, |buf| unsafe {
10-
libc::getrandom(buf.as_mut_ptr().cast(), buf.len(), 0)
10+
let ret = libc::getrandom(buf.as_mut_ptr().cast(), buf.len(), 0);
11+
if ret == 42 {
12+
todo!();
13+
}
14+
ret
1115
})
1216
}

0 commit comments

Comments
 (0)