diff options
author | Tom Cherry <tomcherry@google.com> | 2017-04-24 16:59:05 -0700 |
---|---|---|
committer | Tom Cherry <tomcherry@google.com> | 2017-04-25 11:24:24 -0700 |
commit | fe062055cb11fcb1a6178b046173fc0361ad5b96 (patch) | |
tree | ea784f3dd62a9a30b51a84878c636e57cb1ee18c /init/keyword_map.h | |
parent | 35c5bcc89ce713aca02852dc10247a648187ea28 (diff) | |
download | system_core-fe062055cb11fcb1a6178b046173fc0361ad5b96.tar.gz system_core-fe062055cb11fcb1a6178b046173fc0361ad5b96.tar.bz2 system_core-fe062055cb11fcb1a6178b046173fc0361ad5b96.zip |
ueventd: replace ueventd_parser.cpp with init_parser.cpp
Previously init_parser.cpp was made generic and capable of parsing any
number of differently named 'sections' or prefixed lines. We now use
these capabilities to do the parsing for ueventd.
Bug: 36250207
Bug: 33785894
Test: boot bullhead and ensure the right /dev nodes exist
with the right permissions set
Test: verify no boot time difference
Change-Id: I698ca962d414f8135af32f6c9cd778841b2b8b53
Diffstat (limited to 'init/keyword_map.h')
-rw-r--r-- | init/keyword_map.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/init/keyword_map.h b/init/keyword_map.h index 2b91260ad..88bad014a 100644 --- a/init/keyword_map.h +++ b/init/keyword_map.h @@ -31,11 +31,16 @@ class KeywordMap { virtual ~KeywordMap() { } - const Function FindFunction(const std::string& keyword, - size_t num_args, - std::string* err) const { + const Function FindFunction(const std::vector<std::string>& args, std::string* err) const { using android::base::StringPrintf; + if (args.empty()) { + *err = "keyword needed, but not provided"; + return nullptr; + } + auto& keyword = args[0]; + auto num_args = args.size() - 1; + auto function_info_it = map().find(keyword); if (function_info_it == map().end()) { *err = StringPrintf("invalid keyword '%s'", keyword.c_str()); |