diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cb7ffe34..759f8414 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -173,6 +173,7 @@ jobs: target: [ x86_64-unknown-uefi, x86_64-unknown-l4re-uclibc, + i686-unknown-uefi, ] steps: - uses: actions/checkout@v4 diff --git a/src/backends/rdrand.rs b/src/backends/rdrand.rs index 67dc7129..347786a5 100644 --- a/src/backends/rdrand.rs +++ b/src/backends/rdrand.rs @@ -144,7 +144,7 @@ unsafe fn rdrand_u32() -> Option { unsafe fn rdrand_u64() -> Option { let a = rdrand()?; let b = rdrand()?; - Some((u64::from(a) << 32) || u64::from(b)) + Some((u64::from(a) << 32) | u64::from(b)) } pub fn inner_u32() -> Result { diff --git a/src/error.rs b/src/error.rs index 7449fed3..125051ee 100644 --- a/src/error.rs +++ b/src/error.rs @@ -134,7 +134,7 @@ impl fmt::Debug for Error { let mut dbg = f.debug_struct("Error"); if let Some(errno) = self.raw_os_error() { dbg.field("os_error", &errno); - #[cfg(feature = "std")] + #[cfg(all(feature = "std", not(target_os = "uefi")))] dbg.field("description", &std::io::Error::from_raw_os_error(errno)); } else if let Some(desc) = self.internal_desc() { dbg.field("internal_code", &self.0.get()); @@ -150,7 +150,7 @@ impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { if let Some(errno) = self.raw_os_error() { cfg_if! { - if #[cfg(feature = "std")] { + if #[cfg(all(feature = "std", not(target_os = "uefi")))] { std::io::Error::from_raw_os_error(errno).fmt(f) } else { write!(f, "OS Error: {}", errno) diff --git a/src/error_std_impls.rs b/src/error_std_impls.rs index 2c326012..569165e3 100644 --- a/src/error_std_impls.rs +++ b/src/error_std_impls.rs @@ -5,10 +5,15 @@ use std::io; impl From for io::Error { fn from(err: Error) -> Self { + #[cfg(not(target_os = "uefi"))] match err.raw_os_error() { Some(errno) => io::Error::from_raw_os_error(errno), None => io::Error::new(io::ErrorKind::Other, err), } + #[cfg(target_os = "uefi")] + { + io::Error::new(io::ErrorKind::Other, err) + } } }