You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Update cstr macro
This commit is contained in:
@@ -16,10 +16,10 @@ static KMSG: OnceLock<File> = OnceLock::new();
|
||||
pub fn setup_klog() {
|
||||
// Shut down first 3 fds
|
||||
unsafe {
|
||||
let mut fd = open(str_ptr!("/dev/null"), O_RDWR | O_CLOEXEC);
|
||||
let mut fd = open(raw_cstr!("/dev/null"), O_RDWR | O_CLOEXEC);
|
||||
if fd < 0 {
|
||||
mknod(str_ptr!("/null"), S_IFCHR | 0666, makedev(1, 3));
|
||||
fd = open(str_ptr!("/null"), O_RDWR | O_CLOEXEC);
|
||||
mknod(raw_cstr!("/null"), S_IFCHR | 0666, makedev(1, 3));
|
||||
fd = open(raw_cstr!("/null"), O_RDWR | O_CLOEXEC);
|
||||
fs::remove_file("/null").ok();
|
||||
}
|
||||
|
||||
@@ -35,10 +35,10 @@ pub fn setup_klog() {
|
||||
KMSG.set(kmsg).ok();
|
||||
} else {
|
||||
unsafe {
|
||||
mknod(str_ptr!("/kmsg"), S_IFCHR | 0666, makedev(1, 11));
|
||||
mknod(raw_cstr!("/kmsg"), S_IFCHR | 0666, makedev(1, 11));
|
||||
KMSG.set(File::options().write(true).open("/kmsg").unwrap())
|
||||
.ok();
|
||||
unlink(str_ptr!("/kmsg"));
|
||||
unlink(raw_cstr!("/kmsg"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user