Merge "adb: add support for O_CLOEXEC to unique_fd pipe wrapper."

am: 812a6b77c6

Change-Id: I7a6b5aca9791bbb49eee0d21d26a9ccb3f72a981
This commit is contained in:
Josh Gao 2018-05-23 11:53:17 -07:00 committed by android-build-merger
commit c2eaf16518

View file

@ -28,9 +28,9 @@ struct AdbCloser {
using unique_fd = android::base::unique_fd_impl<AdbCloser>;
#if !defined(_WIN32)
inline bool Pipe(unique_fd* read, unique_fd* write) {
inline bool Pipe(unique_fd* read, unique_fd* write, int flags = 0) {
int pipefd[2];
if (pipe(pipefd) != 0) {
if (pipe2(pipefd, flags) != 0) {
return false;
}
read->reset(pipefd[0]);