diff options
author | Jiyong Park <jiyong@google.com> | 2018-11-16 16:23:20 +0900 |
---|---|---|
committer | Jiyong Park <jiyong@google.com> | 2018-11-16 18:08:46 +0900 |
commit | f169f72fba927ea3e3b6fde0646f38395e80312d (patch) | |
tree | 8823b26b4e86f1c61e8d2a0a3bd600fd0353ebd7 /init/builtins.cpp | |
parent | a59ecfd9407996033736c3710a6b9463512f8972 (diff) | |
download | system_core-f169f72fba927ea3e3b6fde0646f38395e80312d.tar.gz system_core-f169f72fba927ea3e3b6fde0646f38395e80312d.tar.bz2 system_core-f169f72fba927ea3e3b6fde0646f38395e80312d.zip |
Don't fail when no glob match
There can be no match when there is no APEX installed or no APEX is
providing *.rc file. Don't fail in that case.
Bug: 117403679
Test: m apex.test; m; device is is bootable
Change-Id: Ib1c607ee2c156dc236da1df7df0c6663e8d899b2
Diffstat (limited to 'init/builtins.cpp')
-rw-r--r-- | init/builtins.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/init/builtins.cpp b/init/builtins.cpp index 5676f9206..6eb65b2ad 100644 --- a/init/builtins.cpp +++ b/init/builtins.cpp @@ -1060,7 +1060,8 @@ static Result<Success> do_parse_apex_configs(const BuiltinArguments& args) { // where the APEXes are really mounted at. Otherwise, we will parse the // same file twice. static constexpr char glob_pattern[] = "/apex/*@*/etc/*.rc"; - if (glob(glob_pattern, GLOB_MARK, nullptr, &glob_result) != 0) { + const int ret = glob(glob_pattern, GLOB_MARK, nullptr, &glob_result); + if (ret != 0 && ret != GLOB_NOMATCH) { globfree(&glob_result); return Error() << "glob pattern '" << glob_pattern << "' failed"; } |