OSDN Git Service

Do not create prop files for ctl.* properties
authorTom Cherry <tomcherry@google.com>
Fri, 4 Dec 2015 23:53:25 +0000 (15:53 -0800)
committerTom Cherry <tomcherry@google.com>
Fri, 4 Dec 2015 23:55:32 +0000 (15:55 -0800)
Change-Id: Ia6660c68c9e0cb89938751dbc0747ee038394778

libc/bionic/system_properties.cpp

index 9b44ff2..b9a373e 100644 (file)
@@ -915,6 +915,16 @@ static bool initialize_properties() {
             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); });