mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-10-18 12:54:15 +00:00
Fix random return value of faccessat() in x86
faccessat() should return 0 when success, but it returns random number with errno == 0 in x86 platform.
It’s a side effect of commit bf80b08b5f
when magisk binaries ‘corretly’ linked with library of API16 .. lol
Co-authored-by: John Wu <topjohnwu@gmail.com>
This commit is contained in:
@@ -108,7 +108,7 @@ void mv_dir(int src, int dest) {
|
||||
for (dirent *entry; (entry = xreaddir(dir.get()));) {
|
||||
switch (entry->d_type) {
|
||||
case DT_DIR:
|
||||
if (faccessat(dest, entry->d_name, F_OK, 0) == 0) {
|
||||
if (xfaccessat(dest, entry->d_name) == 0) {
|
||||
// Destination folder exists, needs recursive move
|
||||
int newsrc = xopenat(src, entry->d_name, O_RDONLY | O_CLOEXEC);
|
||||
int newdest = xopenat(dest, entry->d_name, O_RDONLY | O_CLOEXEC);
|
||||
|
Reference in New Issue
Block a user