Skip to content

Commit

Permalink
Show crash info correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr-TSNG committed Oct 23, 2023
1 parent abbca19 commit a956dba
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions zygiskd/src/fuse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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"),
}
Expand Down
1 change: 0 additions & 1 deletion zygiskd/src/root_impl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ pub enum RootImpl {
Magisk,
}

// FIXME: OnceCell bugs on 32 bit
static mut ROOT_IMPL: RootImpl = RootImpl::None;

pub fn setup() {
Expand Down
4 changes: 3 additions & 1 deletion zygiskd/src/watchdog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit a956dba

Please sign in to comment.