Skip to content

Commit

Permalink
Try to fix Solaris build
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Richey <joerichey@google.com>
  • Loading branch information
josephlr committed Oct 22, 2022
1 parent bd0654f commit c614924
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Expand Up @@ -167,7 +167,7 @@ jobs:
matrix:
target: [
# See: https://github.com/rust-random/getrandom/issues/254
# sparcv9-sun-solaris,
sparcv9-sun-solaris,
x86_64-unknown-netbsd,
]
steps:
Expand Down
4 changes: 2 additions & 2 deletions src/solaris_illumos.rs
Expand Up @@ -22,7 +22,7 @@ use crate::{
util_libc::{sys_fill_exact, Weak},
Error,
};
use core::mem;
use core::mem::{self, MaybeUninit};

#[cfg(target_os = "illumos")]
type GetRandomFn = unsafe extern "C" fn(*mut u8, libc::size_t, libc::c_uint) -> libc::ssize_t;
Expand All @@ -38,7 +38,7 @@ pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
// derived platforms for atomically obtaining random data.
for chunk in dest.chunks_mut(256) {
sys_fill_exact(chunk, |buf| unsafe {
func(buf.as_mut_ptr(), buf.len(), 0) as libc::ssize_t
func(buf.as_mut_ptr() as *mut u8, buf.len(), 0) as libc::ssize_t
})?
}
Ok(())
Expand Down

0 comments on commit c614924

Please sign in to comment.