Skip to content

Commit

Permalink
make compiler happy
Browse files Browse the repository at this point in the history
  • Loading branch information
5ec1cff committed Nov 4, 2023
1 parent ac53ef1 commit add1c65
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions loader/src/common/socket_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,25 @@ 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 {
ret = write(fd, (std::byte*) buf + write_sz, count - write_sz);
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;
}
Expand Down
2 changes: 1 addition & 1 deletion loader/src/include/socket_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
3 changes: 2 additions & 1 deletion zygiskd/src/root_impl/kernelsu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ pub fn get_kernel_su() -> Option<Version> {
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),
}
}
Expand Down
4 changes: 2 additions & 2 deletions zygiskd/src/watchdog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down

0 comments on commit add1c65

Please sign in to comment.