compsvc: mininize the footprint of raw fd
Bug: 243500154
Test: TH
Change-Id: I1279ec1f7efbc363a16aeb4f3c2e55bf26075585
diff --git a/compos/src/artifact_signer.rs b/compos/src/artifact_signer.rs
index a15df28..e51b8dd 100644
--- a/compos/src/artifact_signer.rs
+++ b/compos/src/artifact_signer.rs
@@ -24,7 +24,7 @@
use protobuf::Message;
use std::fs::File;
use std::io::Write;
-use std::os::unix::io::AsRawFd;
+use std::os::unix::io::AsFd;
use std::path::Path;
const TARGET_DIRECTORY: &str = "/data/misc/apexdata/com.android.art/dalvik-cache";
@@ -52,7 +52,7 @@
let target_path = target_path.to_str().ok_or_else(|| anyhow!("Invalid path"))?;
let file = File::open(path).with_context(|| format!("Opening {}", path.display()))?;
- let digest = fsverity::measure(file.as_raw_fd())?;
+ let digest = fsverity::measure(file.as_fd())?;
let digest = to_hex_string(&digest);
self.file_digests.push((target_path.to_owned(), digest));