From 674ca8644d95d58c03a3a4123b4bf26af4cd21f1 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: Wed, 16 Oct 2024 07:13:00 +0300 Subject: [PATCH] Tweak errno conversion --- src/linux_rustix.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linux_rustix.rs b/src/linux_rustix.rs index 30a6496c..babbad99 100644 --- a/src/linux_rustix.rs +++ b/src/linux_rustix.rs @@ -22,7 +22,7 @@ pub fn getrandom_inner(mut dest: &mut [MaybeUninit]) -> Result<(), Error> { .raw_os_error() .wrapping_neg() .try_into() - .expect("Errno uses u16 internally"); + .map_err(|_| Error::UNEXPECTED)?; return Err(Error::from_os_error(code)); } }