summaryrefslogtreecommitdiffstats
path: root/init/init_parser.c
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2013-01-28 17:13:35 -0800
committerColin Cross <ccross@android.com>2013-06-17 12:44:35 -0700
commit2deedfe0b1ac86ebd62d19cf7da9e7dcb508ab09 (patch)
tree1a2ec1aed9c121e817c6cd7c944680bac33e05e7 /init/init_parser.c
parent406c3bb885538e5003efc3736cd2b57ffef2b5cc (diff)
downloadsystem_core-2deedfe0b1ac86ebd62d19cf7da9e7dcb508ab09.zip
system_core-2deedfe0b1ac86ebd62d19cf7da9e7dcb508ab09.tar.gz
system_core-2deedfe0b1ac86ebd62d19cf7da9e7dcb508ab09.tar.bz2
init: switch property_get to use __system_property_get
Change-Id: I4fc0502a1a5b331087618a4d2e3d90948743d7bd
Diffstat (limited to 'init/init_parser.c')
-rw-r--r--init/init_parser.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/init/init_parser.c b/init/init_parser.c
index a1d2423..28bf30c 100644
--- a/init/init_parser.c
+++ b/init/init_parser.c
@@ -208,8 +208,9 @@ int expand_props(char *dst, const char *src, int dst_size)
while (*src_ptr && left > 0) {
char *c;
char prop[PROP_NAME_MAX + 1];
- const char *prop_val;
+ char prop_val[PROP_VALUE_MAX];
int prop_len = 0;
+ int prop_val_len;
c = strchr(src_ptr, '$');
if (!c) {
@@ -267,14 +268,14 @@ int expand_props(char *dst, const char *src, int dst_size)
goto err;
}
- prop_val = property_get(prop);
- if (!prop_val) {
+ prop_val_len = property_get(prop, prop_val);
+ if (!prop_val_len) {
ERROR("property '%s' doesn't exist while expanding '%s'\n",
prop, src);
goto err;
}
- ret = push_chars(&dst_ptr, &left, prop_val, strlen(prop_val));
+ ret = push_chars(&dst_ptr, &left, prop_val, prop_val_len);
if (ret < 0)
goto err_nospace;
src_ptr = c;
@@ -545,7 +546,7 @@ void queue_all_property_triggers()
const char* equals = strchr(name, '=');
if (equals) {
char prop_name[PROP_NAME_MAX + 1];
- const char* value;
+ char value[PROP_VALUE_MAX];
int length = equals - name;
if (length > PROP_NAME_MAX) {
ERROR("property name too long in trigger %s", act->name);
@@ -554,9 +555,8 @@ void queue_all_property_triggers()
prop_name[length] = 0;
/* does the property exist, and match the trigger value? */
- value = property_get(prop_name);
- if (value && (!strcmp(equals + 1, value) ||
- !strcmp(equals + 1, "*"))) {
+ property_get(prop_name, value);
+ if (!strcmp(equals + 1, value) ||!strcmp(equals + 1, "*")) {
action_add_queue_tail(act);
}
}