mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-06-13 05:37:47 +02:00
Enable Zygisk
This commit is contained in:
@ -26,7 +26,7 @@ int fd_pathat(int dirfd, const char *name, char *path, size_t size) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int mkdirs(string path, mode_t mode) {
|
||||
int mkdirs(string_view path, mode_t mode) {
|
||||
errno = 0;
|
||||
for (char *p = path.data() + 1; *p; ++p) {
|
||||
if (*p == '/') {
|
||||
@ -420,7 +420,7 @@ void restore_folder(const char *dir, vector<raw_file> &files) {
|
||||
for (raw_file &file : files) {
|
||||
string path = base + "/" + file.path;
|
||||
if (S_ISDIR(file.attr.st.st_mode)) {
|
||||
mkdirs(path.data(), 0);
|
||||
mkdirs(path, 0);
|
||||
} else if (S_ISREG(file.attr.st.st_mode)) {
|
||||
auto fp = xopen_file(path.data(), "we");
|
||||
if (fp) fwrite(file.buf, 1, file.sz, fp.get());
|
||||
|
@ -32,7 +32,7 @@ struct raw_file {
|
||||
|
||||
ssize_t fd_path(int fd, char *path, size_t size);
|
||||
int fd_pathat(int dirfd, const char *name, char *path, size_t size);
|
||||
int mkdirs(std::string path, mode_t mode);
|
||||
int mkdirs(std::string_view path, mode_t mode);
|
||||
void rm_rf(const char *path);
|
||||
void mv_path(const char *src, const char *dest);
|
||||
void mv_dir(int src, int dest);
|
||||
|
@ -466,7 +466,7 @@ void *xmmap(void *addr, size_t length, int prot, int flags,
|
||||
|
||||
ssize_t xsendfile(int out_fd, int in_fd, off_t *offset, size_t count) {
|
||||
ssize_t ret = sendfile(out_fd, in_fd, offset, count);
|
||||
if (count != ret) {
|
||||
if (ret < 0) {
|
||||
PLOGE("sendfile");
|
||||
}
|
||||
return ret;
|
||||
|
Reference in New Issue
Block a user