am 0b7d588d: am f2c4c4ad: Merge "init: Fix queue_all_property_triggers with nonexistent properties"

* commit '0b7d588d531691904530ba57d772b31fb24ed343':
  init: Fix queue_all_property_triggers with nonexistent properties
This commit is contained in:
Benoit Goby 2013-09-24 16:15:43 -07:00 committed by Android Git Automerger
commit 4820022b5e
1 changed files with 4 additions and 2 deletions

View File

@ -552,12 +552,14 @@ void queue_all_property_triggers()
if (length > PROP_NAME_MAX) {
ERROR("property name too long in trigger %s", act->name);
} else {
int ret;
memcpy(prop_name, name, length);
prop_name[length] = 0;
/* does the property exist, and match the trigger value? */
property_get(prop_name, value);
if (!strcmp(equals + 1, value) ||!strcmp(equals + 1, "*")) {
ret = property_get(prop_name, value);
if (ret > 0 && (!strcmp(equals + 1, value) ||
!strcmp(equals + 1, "*"))) {
action_add_queue_tail(act);
}
}