C++/Rust 2 way binding for MagiskD

This commit is contained in:
topjohnwu
2023-11-17 13:35:50 -08:00
parent 6c0966b795
commit 8d5b9e5329
11 changed files with 234 additions and 176 deletions
+1 -9
View File
@@ -3,7 +3,7 @@ use std::ffi::{c_char, c_void};
use std::fmt::Write as FmtWrite;
use std::fs::File;
use std::io::{IoSlice, Read, Write};
use std::os::fd::{AsRawFd, FromRawFd, RawFd};
use std::os::fd::{FromRawFd, RawFd};
use std::ptr::null_mut;
use std::sync::atomic::{AtomicI32, Ordering};
use std::{fs, io};
@@ -382,14 +382,6 @@ impl MagiskD {
}
}
pub fn get_log_pipe(&self) -> RawFd {
self.logd
.lock()
.unwrap()
.as_ref()
.map_or(-1, |s| s.as_raw_fd())
}
pub fn close_log_pipe(&self) {
*self.logd.lock().unwrap() = None;
}