diff --git a/loader/src/common/socket_utils.cpp b/loader/src/common/socket_utils.cpp index 73dd1d24..d4a9f1d5 100644 --- a/loader/src/common/socket_utils.cpp +++ b/loader/src/common/socket_utils.cpp @@ -19,12 +19,12 @@ namespace socket_utils { read_sz += ret; } while (read_sz != count && ret != 0); if (read_sz != count) { - PLOGE("read (%d != %d)", count, read_sz); + PLOGE("read (%zu != %zu)", count, read_sz); } return read_sz; } - ssize_t xwrite(int fd, const void* buf, size_t count) { + size_t xwrite(int fd, const void* buf, size_t count) { size_t write_sz = 0; ssize_t ret; do { @@ -32,12 +32,12 @@ namespace socket_utils { if (ret < 0) { if (errno == EINTR) continue; PLOGE("write"); - return ret; + return write_sz; } write_sz += ret; } while (write_sz != count && ret != 0); if (write_sz != count) { - PLOGE("write (%d != %d)", count, write_sz); + PLOGE("write (%zu != %zu)", count, write_sz); } return write_sz; } diff --git a/loader/src/include/socket_utils.h b/loader/src/include/socket_utils.h index b2775d79..09330de9 100644 --- a/loader/src/include/socket_utils.h +++ b/loader/src/include/socket_utils.h @@ -9,7 +9,7 @@ namespace socket_utils { ssize_t xread(int fd, void *buf, size_t count); - ssize_t xwrite(int fd, const void *buf, size_t count); + size_t xwrite(int fd, const void *buf, size_t count); uint8_t read_u8(int fd); diff --git a/zygiskd/src/root_impl/kernelsu.rs b/zygiskd/src/root_impl/kernelsu.rs index e92163ca..d629b20e 100644 --- a/zygiskd/src/root_impl/kernelsu.rs +++ b/zygiskd/src/root_impl/kernelsu.rs @@ -23,10 +23,11 @@ pub fn get_kernel_su() -> Option { 0, ) }; + const MAX_OLD_VERSION: i32 = MIN_KSU_VERSION - 1; match version { 0 => None, MIN_KSU_VERSION..=MAX_KSU_VERSION => Some(Version::Supported), - 1..=MIN_KSU_VERSION => Some(Version::TooOld), + 1..=MAX_OLD_VERSION => Some(Version::TooOld), _ => Some(Version::Abnormal), } } diff --git a/zygiskd/src/watchdog.rs b/zygiskd/src/watchdog.rs index dff6532d..c0ef32aa 100644 --- a/zygiskd/src/watchdog.rs +++ b/zygiskd/src/watchdog.rs @@ -3,8 +3,8 @@ use anyhow::{bail, Result}; use std::fs; use std::io::{BufRead, BufReader, Write}; use std::time::Duration; -use futures::{FutureExt, join, pin_mut}; -use futures::future::{Fuse, FusedFuture}; +use futures::{FutureExt, pin_mut}; +use futures::future::{Fuse}; use log::{debug, error, info}; use rustix::mount::mount_bind; use rustix::process::{getgid, getuid};