Upgrade to nix-0.22.0.
The nix upgrade changes nix::Error to implement Into<std::io::Error>,
which removes the need for us to do that on our own.
https://github.com/nix-rust/nix/pull/1446 has more details.
Test: Build
Change-Id: Ifed70bbe1fd45bb36bb12077c4a8a6492e6f0de6
diff --git a/authfs/fd_server/src/fsverity.rs b/authfs/fd_server/src/fsverity.rs
index e89bbd0..576f9dd 100644
--- a/authfs/fd_server/src/fsverity.rs
+++ b/authfs/fd_server/src/fsverity.rs
@@ -47,16 +47,7 @@
buf_ptr: buf.as_mut_ptr() as u64,
__reserved: 0,
};
- Ok(unsafe { read_verity_metadata(fd, &mut arg) }.map_err(|e| {
- if let nix::Error::Sys(errno) = e {
- io::Error::from_raw_os_error(errno as i32)
- } else {
- // Document of nix::sys::ioctl indicates the macro-generated function always returns an
- // nix::errno::Errno, which can be converted nix::Error::Sys above. As the result, this
- // branch is unreachable.
- unreachable!();
- }
- })? as usize)
+ Ok(unsafe { read_verity_metadata(fd, &mut arg) }? as usize)
}
/// Read the raw Merkle tree from the fd, if it exists. The API semantics is similar to a regular