diff options
| author | Benoit Goby <benoit@android.com> | 2013-09-24 14:42:26 -0700 |
|---|---|---|
| committer | Benoit Goby <benoit@android.com> | 2013-09-24 15:20:34 -0700 |
| commit | d679e1b572c8fc2a115b7d126593f92abd746aab (patch) | |
| tree | 633f2f9d5df08d4fe6f8c18067cdf219c07f1fcd /init | |
| parent | 3c8bdef029cbaa8d8fa18e4e55e51b60e938dd6e (diff) | |
| download | core-d679e1b572c8fc2a115b7d126593f92abd746aab.tar.gz core-d679e1b572c8fc2a115b7d126593f92abd746aab.tar.bz2 core-d679e1b572c8fc2a115b7d126593f92abd746aab.zip | |
init: Fix queue_all_property_triggers with nonexistent properties
Don't queue actions for "on property=*" if the property does not exist.
This fixes these errors on boot:
init: property 'sys.powerctl' doesn't exist while
expanding '${sys.powerctl}'
init: powerctl: cannot expand '${sys.powerctl}
Change-Id: I3bd354d73a860f856be5df2c654f940445f9efd9
Diffstat (limited to 'init')
| -rw-r--r-- | init/init_parser.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/init/init_parser.c b/init/init_parser.c index 616671a30..2c2c91c0c 100644 --- a/init/init_parser.c +++ b/init/init_parser.c @@ -549,12 +549,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); } } |
