From 2f1f68f12f567d9d0351359b3d8d50a4e85335fd Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Fri, 3 Apr 2020 02:58:39 -0700 Subject: [PATCH] Prepare compilation for NDK r21 --- native/jni/external/busybox | 2 +- native/jni/init/init.cpp | 6 +++--- native/jni/systemproperties/prop_info.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/native/jni/external/busybox b/native/jni/external/busybox index 172151eb0..04d8621fd 160000 --- a/native/jni/external/busybox +++ b/native/jni/external/busybox @@ -1 +1 @@ -Subproject commit 172151eb0dd8c774459beaf6b116c63f8cf528aa +Subproject commit 04d8621fd3eb6d5e2863924daca49d37f89a2f09 diff --git a/native/jni/init/init.cpp b/native/jni/init/init.cpp index 7b4ed0075..64548160d 100644 --- a/native/jni/init/init.cpp +++ b/native/jni/init/init.cpp @@ -102,7 +102,7 @@ static void decompress_ramdisk() { uint8_t *buf; size_t sz; mmap_ro(ramdisk_xz, buf, sz); - int fd = open(tmp, O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC); + int fd = xopen(tmp, O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, 0644); unxz(fd, buf, sz); munmap(buf, sz); close(fd); @@ -113,7 +113,7 @@ static void decompress_ramdisk() { } int dump_magisk(const char *path, mode_t mode) { - int fd = open(path, O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, mode); + int fd = xopen(path, O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, mode); if (fd < 0) return 1; if (!unxz(fd, magisk_xz, sizeof(magisk_xz))) @@ -123,7 +123,7 @@ int dump_magisk(const char *path, mode_t mode) { } static int dump_manager(const char *path, mode_t mode) { - int fd = open(path, O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, mode); + int fd = xopen(path, O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, mode); if (fd < 0) return 1; if (!unxz(fd, manager_xz, sizeof(manager_xz))) diff --git a/native/jni/systemproperties/prop_info.cpp b/native/jni/systemproperties/prop_info.cpp index 890d1cff3..aed529adf 100644 --- a/native/jni/systemproperties/prop_info.cpp +++ b/native/jni/systemproperties/prop_info.cpp @@ -47,7 +47,7 @@ prop_info::prop_info(const char* name, uint32_t namelen, uint32_t long_offset) { memcpy(this->name, name, namelen); this->name[namelen] = '\0'; - auto error_value_len = sizeof(kLongLegacyError) - 1; + atomic_uint_least32_t error_value_len = sizeof(kLongLegacyError) - 1; atomic_init(&this->serial, error_value_len << 24 | kLongFlag); memcpy(this->long_property.error_message, kLongLegacyError, sizeof(kLongLegacyError));