Show crash info correctly

This commit is contained in:
Nullptr
2023-10-23 22:22:00 +08:00
parent abbca19c82
commit a956dba77d
3 changed files with 8 additions and 4 deletions

View File

@@ -9,7 +9,8 @@ use libc::ENOENT;
use log::{debug, error, info};
use proc_maps::{get_process_maps, MapRange, Pid};
use ptrace_do::{RawProcess, TracedProcess};
use rustix::mount::mount_bind;
use rustix::fs::UnmountFlags;
use rustix::mount::{mount_bind, unmount};
use rustix::path::Arg;
use rustix::process::getpid;
use crate::{constants, dl};
@@ -321,7 +322,9 @@ pub fn main() -> Result<()> {
&options,
)?;
mount_bind(constants::PATH_FUSE_PCL, constants::PATH_PCL)?;
match session.guard.join() {
let crash = session.guard.join();
unmount(constants::PATH_PCL, UnmountFlags::DETACH)?;
match crash {
Err(e) => bail!("Fuse mount crashed: {:?}", e),
_ => bail!("Fuse mount exited unexpectedly"),
}

View File

@@ -10,7 +10,6 @@ pub enum RootImpl {
Magisk,
}
// FIXME: OnceCell bugs on 32 bit
static mut ROOT_IMPL: RootImpl = RootImpl::None;
pub fn setup() {

View File

@@ -18,7 +18,9 @@ static PROP_SECTIONS: LateInit<[String; 2]> = LateInit::new();
pub async fn main() -> Result<()> {
let result = run().await;
set_prop_hint(constants::STATUS_CRASHED)?;
if result.is_err() {
set_prop_hint(constants::STATUS_CRASHED)?;
}
result
}