Add log_ok() for log().ok()

This commit is contained in:
LoveSy
2025-02-04 21:15:16 +08:00
committed by John Wu
parent b1e17706a4
commit 9a74e19117
7 changed files with 36 additions and 30 deletions
+4 -4
View File
@@ -109,7 +109,7 @@ impl MagiskD {
let secure_dir = FsPath::from(cstr!(SECURE_DIR));
if !secure_dir.exists() {
if self.sdk_int < 24 {
secure_dir.mkdir(0o700).log().ok();
secure_dir.mkdir(0o700).log_ok();
} else {
error!("* {} is not present, abort", SECURE_DIR);
return true;
@@ -137,7 +137,7 @@ impl MagiskD {
info!("* Safe mode triggered");
// Disable all modules and zygisk so next boot will be clean
disable_modules();
self.set_db_setting(DbEntryKey::ZygiskConfig, 0).log().ok();
self.set_db_setting(DbEntryKey::ZygiskConfig, 0).log_ok();
return true;
}
@@ -170,12 +170,12 @@ impl MagiskD {
info!("** boot-complete triggered");
// Reset the bootloop counter once we have boot-complete
self.set_db_setting(DbEntryKey::BootloopCount, 0).log().ok();
self.set_db_setting(DbEntryKey::BootloopCount, 0).log_ok();
// At this point it's safe to create the folder
let secure_dir = FsPath::from(cstr!(SECURE_DIR));
if !secure_dir.exists() {
secure_dir.mkdir(0o700).log().ok();
secure_dir.mkdir(0o700).log_ok();
}
self.ensure_manager();
+1 -1
View File
@@ -314,7 +314,7 @@ impl MagiskD {
out.push('=');
out.push_str(values.get_text(i as i32));
}
writer.write_encodable(&out).log().ok();
writer.write_encodable(&out).log_ok();
};
self.db_exec_with_rows(&sql, &[], &mut output_fn);
writer.write_encodable("").log()
+2 -2
View File
@@ -465,11 +465,11 @@ impl MagiskD {
if let Ok(mut fd) = apk.open(O_RDONLY | O_CLOEXEC) {
info.trusted_cert = read_certificate(&mut fd, MAGISK_VER_CODE);
// Seek the fd back to start
fd.seek(SeekFrom::Start(0)).log().ok();
fd.seek(SeekFrom::Start(0)).log_ok();
info.stub_apk_fd = Some(fd);
}
apk.remove().log().ok();
apk.remove().log_ok();
}
pub fn get_manager_uid(&self, user: i32) -> i32 {