aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Burgess IV2018-02-17 19:48:45 -0600
committerGeorge Burgess IV2018-02-22 21:25:22 -0600
commit1cfb36112901eaf44110d8a29355c3116bee4a3a (patch)
tree017221e701fe934293694f48d691cf0c15b6bd5d
parent31bcd7c002c0b556790e7fa0db39297f1624e7e1 (diff)
downloadplatform-bootable-recovery-1cfb36112901eaf44110d8a29355c3116bee4a3a.tar.gz
platform-bootable-recovery-1cfb36112901eaf44110d8a29355c3116bee4a3a.tar.xz
platform-bootable-recovery-1cfb36112901eaf44110d8a29355c3116bee4a3a.zip
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
-rw-r--r--roots.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/roots.cpp b/roots.cpp
index e2d5d654..9ff5186c 100644
--- a/roots.cpp
+++ b/roots.cpp
@@ -189,7 +189,7 @@ static int exec_cmd(const std::vector<std::string>& args) {
189 argv.push_back(nullptr); 189 argv.push_back(nullptr);
190 190
191 pid_t child; 191 pid_t child;
192 if ((child = vfork()) == 0) { 192 if ((child = fork()) == 0) {
193 execv(argv[0], argv.data()); 193 execv(argv[0], argv.data());
194 _exit(EXIT_FAILURE); 194 _exit(EXIT_FAILURE);
195 } 195 }