Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit adba5330 authored by Dennis Shen's avatar Dennis Shen Committed by Gerrit Code Review
Browse files

Merge "aconfig_storage_read_api: make map_file function public." into main

parents 51bca987 f33532e7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ pub mod package_table_query;

pub use aconfig_storage_file::{AconfigStorageError, FlagValueType, StorageFileType};
pub use flag_table_query::FlagReadContext;
pub use mapped_file::map_file;
pub use package_table_query::PackageReadContext;

use aconfig_storage_file::read_u32_from_bytes;
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ use crate::StorageFileType;
/// The memory mapped file may have undefined behavior if there are writes to this
/// file after being mapped. Ensure no writes can happen to this file while this
/// mapping stays alive.
unsafe fn map_file(file_path: &str) -> Result<Mmap, AconfigStorageError> {
pub unsafe fn map_file(file_path: &str) -> Result<Mmap, AconfigStorageError> {
    let file = File::open(file_path)
        .map_err(|errmsg| FileReadFail(anyhow!("Failed to open file {}: {}", file_path, errmsg)))?;
    unsafe {