Merge "Check for errors in dup2" am: b1166633b6 am: 1d5d475b51

am: 7748fcf911

Change-Id: Idfb0af866594647a43832d1cbc1b7a597f139144
This commit is contained in:
Paul Crowley 2018-12-07 18:27:40 -08:00 committed by android-build-merger
commit 042dfdde7b

View file

@ -312,7 +312,10 @@ status_t ForkExecvp(const std::vector<std::string>& args, std::vector<std::strin
} }
} }
pipe_read.reset(); pipe_read.reset();
dup2(pipe_write.get(), STDOUT_FILENO); if (dup2(pipe_write.get(), STDOUT_FILENO) == -1) {
PLOG(ERROR) << "dup2 in ForkExecvp";
_exit(EXIT_FAILURE);
}
pipe_write.reset(); pipe_write.reset();
execvp(argv[0], const_cast<char**>(argv.data())); execvp(argv[0], const_cast<char**>(argv.data()));
PLOG(ERROR) << "exec in ForkExecvp"; PLOG(ERROR) << "exec in ForkExecvp";