Merge "Don't let missing Treble property context files affect errno." into oc-dev
diff --git a/libc/bionic/system_properties.cpp b/libc/bionic/system_properties.cpp
index a4faf85..2a42390 100644
--- a/libc/bionic/system_properties.cpp
+++ b/libc/bionic/system_properties.cpp
@@ -54,6 +54,7 @@
#include <sys/_system_properties.h>
#include <sys/system_properties.h>
+#include "private/ErrnoRestorer.h"
#include "private/bionic_futex.h"
#include "private/bionic_lock.h"
#include "private/bionic_macros.h"
@@ -1096,6 +1097,9 @@
}
int __system_properties_init() {
+ // This is called from __libc_init_common, and should leave errno at 0 (http://b/37248982).
+ ErrnoRestorer errno_restorer;
+
if (initialized) {
list_foreach(contexts, [](context_node* l) { l->reset_access(); });
return 0;