Replace vfork() with fork().

The static analyzer complained about the function calls we were doing
here to vector::data() and vector::operator[]:
bootable/recovery/roots.cpp:193:11: warning: This function call is
prohibited after a successful vfork

Since it's not clear that vfork() is needed here, just use fork()
instead.

Bug: None
Test: Reran the static analyzer with only this patch applied. Bug
disappeared
Change-Id: I580f8243a21899f1e1678c8aee6948dfa7f69a1d
This commit is contained in:
George Burgess IV
2018-02-17 17:48:45 -08:00
parent 31bcd7c002
commit 1cfb361129

View File

@@ -189,7 +189,7 @@ static int exec_cmd(const std::vector<std::string>& args) {
argv.push_back(nullptr);
pid_t child;
if ((child = vfork()) == 0) {
if ((child = fork()) == 0) {
execv(argv[0], argv.data());
_exit(EXIT_FAILURE);
}