Fix bug in fs_mgr with calling vdc

Parameter count was hard coded to 3, make dynamic

Test: Metadata encrypted device boots

Change-Id: I25bb5adb7f27fc392564bfa6ed3ed2efeb5c5a40
This commit is contained in:
Paul Lawrence 2018-08-29 12:31:01 -07:00
parent 7b02605bf2
commit c735bfe5da

View file

@ -791,7 +791,8 @@ static bool call_vdc(const std::vector<std::string>& args) {
argv.emplace_back(arg.c_str());
}
LOG(INFO) << "Calling: " << android::base::Join(argv, ' ');
int ret = android_fork_execvp(4, const_cast<char**>(argv.data()), nullptr, false, true);
int ret =
android_fork_execvp(argv.size(), const_cast<char**>(argv.data()), nullptr, false, true);
if (ret != 0) {
LOG(ERROR) << "vdc returned error code: " << ret;
return false;