Rename cstr_buf to cstr::buf

This commit is contained in:
topjohnwu
2025-04-22 02:55:53 -07:00
committed by John Wu
parent ab2e5d1e7e
commit e02b5f7868
16 changed files with 65 additions and 63 deletions
+2 -2
View File
@@ -2,7 +2,7 @@ use crate::ffi::MagiskInit;
use base::libc::{TMPFS_MAGIC, statfs};
use base::{
Directory, FsPath, FsPathBuilder, FsPathMnt, LibcReturn, LoggedResult, ResultExt, Utf8CStr,
cstr, cstr_buf, debug, libc,
cstr, debug, libc,
libc::{chdir, chroot, execve, exit, mount},
parse_mount_info, raw_cstr,
};
@@ -38,7 +38,7 @@ pub(crate) fn switch_root(path: &Utf8CStr) {
let mut target = info.target.clone();
let target = Utf8CStr::from_string(&mut target);
let new_path = cstr_buf::default()
let new_path = cstr::buf::default()
.join_path(path)
.join_path(info.target.trim_start_matches('/'));
new_path.mkdirs(0o755).ok();
+4 -4
View File
@@ -3,7 +3,7 @@ use crate::ffi::MagiskInit;
use base::libc::{O_CREAT, O_RDONLY, O_WRONLY};
use base::{
BufReadExt, Directory, FsPath, FsPathBuilder, FsPathMnt, LoggedResult, ResultExt, Utf8CStr,
Utf8CString, clone_attr, cstr, cstr_buf, debug,
Utf8CString, clone_attr, cstr, debug,
};
use std::io::BufReader;
use std::{
@@ -66,14 +66,14 @@ impl MagiskInit {
mount_list: &mut String,
) -> LoggedResult<()> {
let mut dir = Directory::open(src_dir)?;
let mut con = cstr_buf::default();
let mut con = cstr::buf::default();
loop {
match &dir.read()? {
None => return Ok(()),
Some(e) => {
let name = e.name();
let src = cstr_buf::dynamic(256).join_path(src_dir).join_path(name);
let dest = cstr_buf::dynamic(256).join_path(dest_dir).join_path(name);
let src = cstr::buf::dynamic(256).join_path(src_dir).join_path(name);
let dest = cstr::buf::dynamic(256).join_path(dest_dir).join_path(name);
if dest.exists() {
if e.is_dir() {
// Recursive