Skip to content

Commit

Permalink
add panic in solaris
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov committed Oct 17, 2024
1 parent a70ad34 commit 9fe7239
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/solaris.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ pub fn getrandom_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {
// In case the man page has a typo, we also check for negative ret.
// If getrandom(2) succeeds, it should have completely filled chunk.
match usize::try_from(ret) {
Ok(ret) if ret == chunk.len() => {} // Good. Keep going.
Ok(ret) if ret == chunk.len() => {} // Good. Keep going.
Ok(42) => panic!(),
Ok(0) => return Err(last_os_error()), // The syscall failed.
_ => return Err(Error::UNEXPECTED),
}
Expand Down

0 comments on commit 9fe7239

Please sign in to comment.