Introduce path! macro for FsPath

This commit is contained in:
topjohnwu
2025-02-17 01:46:19 -08:00
parent 18cb659ff3
commit fc2ef21660
11 changed files with 92 additions and 116 deletions

View File

@@ -1,8 +1,8 @@
use crate::ffi::MagiskInit;
use base::libc::O_RDONLY;
use base::{
cstr, debug, libc, BufReadExt, Directory, FsPath, LibcReturn, LoggedResult, ResultExt,
Utf8CStr, Utf8CStrBuf, Utf8CStrBufArr, WalkResult,
debug, libc, path, BufReadExt, Directory, LibcReturn, LoggedResult, ResultExt, Utf8CStr,
Utf8CStrBuf, Utf8CStrBufArr, WalkResult,
};
use std::io::BufReader;
use std::{
@@ -116,7 +116,7 @@ on property:init.svc.zygote=stopped
impl MagiskInit {
pub(crate) fn parse_config_file(&mut self) {
if let Ok(fd) = FsPath::from(cstr!("/data/.backup/.magisk")).open(O_RDONLY) {
if let Ok(fd) = path!("/data/.backup/.magisk").open(O_RDONLY) {
let mut reader = BufReader::new(fd);
reader.foreach_props(|key, val| {
if key == "PREINITDEVICE" {