From 9fe72397a795bd1d4d9906b5e0d50c32f61988ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Thu, 17 Oct 2024 22:19:12 +0300 Subject: [PATCH] add panic in solaris --- src/solaris.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/solaris.rs b/src/solaris.rs index 203000b0..803d1da9 100644 --- a/src/solaris.rs +++ b/src/solaris.rs @@ -24,7 +24,8 @@ pub fn getrandom_inner(dest: &mut [MaybeUninit]) -> 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), }