mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-10-15 17:10:17 +00:00
Fix FORTIFY crashes
This commit is contained in:
@@ -53,6 +53,14 @@ int xopenat(int dirfd, const char *pathname, int flags) {
|
||||
return fd;
|
||||
}
|
||||
|
||||
int xopenat(int dirfd, const char *pathname, int flags, mode_t mode) {
|
||||
int fd = openat(dirfd, pathname, flags, mode);
|
||||
if (fd < 0) {
|
||||
PLOGE("openat: %s", pathname);
|
||||
}
|
||||
return fd;
|
||||
}
|
||||
|
||||
ssize_t xwrite(int fd, const void *buf, size_t count) {
|
||||
int ret = write(fd, buf, count);
|
||||
if (count != ret) {
|
||||
@@ -435,3 +443,11 @@ int xinotify_init1(int flags) {
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
char *xrealpath(const char *path, char *resolved_path) {
|
||||
char *ret = realpath(path, resolved_path);
|
||||
if (ret == nullptr) {
|
||||
PLOGE("xrealpath");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user