Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9479e823 authored by Josh Gao's avatar Josh Gao Committed by android-build-merger
Browse files

Merge "adb: add support for O_CLOEXEC to unique_fd pipe wrapper." am: 812a6b77 am: c2eaf165

am: 6926173b

Change-Id: I095dad4ad0d8eb76de8cfeec3e008d8901f09332
parents f9ddfc55 6926173b
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -28,9 +28,9 @@ struct AdbCloser {
using unique_fd = android::base::unique_fd_impl<AdbCloser>;
using unique_fd = android::base::unique_fd_impl<AdbCloser>;


#if !defined(_WIN32)
#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];
    int pipefd[2];
    if (pipe(pipefd) != 0) {
    if (pipe2(pipefd, flags) != 0) {
        return false;
        return false;
    }
    }
    read->reset(pipefd[0]);
    read->reset(pipefd[0]);