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

Commit 948b3e10 authored by Josh Gao's avatar Josh Gao
Browse files

adb: add support for O_CLOEXEC to unique_fd pipe wrapper.

Change-Id: I8fd22fe55db4d3dbcbb7318cf4a364eb07323ed0
parent 3b37fa25
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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]);