Merge "Allow dlopening public libs using absolute path"
diff --git a/benchmarks/Benchmark.cpp b/benchmarks/Benchmark.cpp
index ea6000f..a7ab682 100644
--- a/benchmarks/Benchmark.cpp
+++ b/benchmarks/Benchmark.cpp
@@ -24,7 +24,7 @@
#include <string>
#include <vector>
-#include <base/stringprintf.h>
+#include <android-base/stringprintf.h>
#include <benchmark/Benchmark.h>
diff --git a/benchmarks/utils.cpp b/benchmarks/utils.cpp
index cf17edb..8bbd20a 100644
--- a/benchmarks/utils.cpp
+++ b/benchmarks/utils.cpp
@@ -23,7 +23,7 @@
#include <string>
-#include <base/stringprintf.h>
+#include <android-base/stringprintf.h>
int Round(int n) {
int base = 1;
diff --git a/libc/bionic/system_properties.cpp b/libc/bionic/system_properties.cpp
index 3fd41d7..b9a373e 100644
--- a/libc/bionic/system_properties.cpp
+++ b/libc/bionic/system_properties.cpp
@@ -915,6 +915,16 @@
free(prop_prefix);
continue;
}
+ /*
+ * init uses ctl.* properties as an IPC mechanism and does not write them
+ * to a property file, therefore we do not need to create property files
+ * to store them.
+ */
+ if (!strncmp(prop_prefix, "ctl.", 4)) {
+ free(prop_prefix);
+ free(context);
+ continue;
+ }
auto old_context = list_find(
contexts, [context](context_node* l) { return !strcmp(l->context, context); });
@@ -1006,6 +1016,10 @@
const prop_info *__system_property_find(const char *name)
{
+ if (!__system_property_area__) {
+ return nullptr;
+ }
+
if (__predict_false(compat_mode)) {
return __system_property_find_compat(name);
}
@@ -1091,11 +1105,15 @@
int __system_property_update(prop_info *pi, const char *value, unsigned int len)
{
- prop_area *pa = __system_property_area__;
-
if (len >= PROP_VALUE_MAX)
return -1;
+ prop_area* pa = __system_property_area__;
+
+ if (!pa) {
+ return -1;
+ }
+
uint32_t serial = atomic_load_explicit(&pi->serial, memory_order_relaxed);
serial |= 1;
atomic_store_explicit(&pi->serial, serial, memory_order_relaxed);
@@ -1129,6 +1147,10 @@
if (namelen < 1)
return -1;
+ if (!__system_property_area__) {
+ return -1;
+ }
+
prop_area* pa = get_prop_area_for_name(name);
if (!pa) {
@@ -1168,6 +1190,10 @@
prop_area *pa = __system_property_area__;
uint32_t my_serial;
+ if (!pa) {
+ return 0;
+ }
+
do {
__futex_wait(pa->serial(), serial, NULL);
my_serial = atomic_load_explicit(pa->serial(), memory_order_acquire);
@@ -1191,6 +1217,10 @@
int __system_property_foreach(void (*propfn)(const prop_info *pi, void *cookie),
void *cookie)
{
+ if (!__system_property_area__) {
+ return -1;
+ }
+
if (__predict_false(compat_mode)) {
return __system_property_foreach_compat(propfn, cookie);
}
diff --git a/linker/linker.cpp b/linker/linker.cpp
index 3b1e1d4..82d0d9e 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -60,7 +60,7 @@
#include "linker_reloc_iterators.h"
#include "linker_utils.h"
-#include "base/strings.h"
+#include "android-base/strings.h"
#include "ziparchive/zip_archive.h"
extern void __libc_init_globals(KernelArgumentBlock&);
diff --git a/tests/unistd_test.cpp b/tests/unistd_test.cpp
index 0a97abc..5e06b1f 100644
--- a/tests/unistd_test.cpp
+++ b/tests/unistd_test.cpp
@@ -30,8 +30,8 @@
#include <sys/wait.h>
#include <unistd.h>
-#include <base/file.h>
-#include <base/strings.h>
+#include <android-base/file.h>
+#include <android-base/strings.h>
#include "private/get_cpu_count_from_string.h"
diff --git a/tests/utils.h b/tests/utils.h
index 9e77f24..a8f3441 100644
--- a/tests/utils.h
+++ b/tests/utils.h
@@ -24,8 +24,8 @@
#include <string>
#include <regex>
-#include <base/file.h>
-#include <base/stringprintf.h>
+#include <android-base/file.h>
+#include <android-base/stringprintf.h>
#include "private/ScopeGuard.h"