| Index: util/test/multiprocess_exec_posix.cc
|
| diff --git a/util/test/multiprocess_exec.cc b/util/test/multiprocess_exec_posix.cc
|
| similarity index 92%
|
| rename from util/test/multiprocess_exec.cc
|
| rename to util/test/multiprocess_exec_posix.cc
|
| index 2e725dc9effdf3a32c9d0799d46553fb7fa1ff15..f87cc7600ad3478c5cf20cfab2b347e61fc87775 100644
|
| --- a/util/test/multiprocess_exec.cc
|
| +++ b/util/test/multiprocess_exec_posix.cc
|
| @@ -72,21 +72,21 @@ void MultiprocessExec::MultiprocessChild() {
|
| static_assert(STDERR_FILENO == 2, "stderr must be fd 2");
|
|
|
| // Move the read pipe to stdin.
|
| - int read_fd = ReadPipeFD();
|
| - ASSERT_NE(read_fd, STDIN_FILENO);
|
| - ASSERT_NE(read_fd, STDOUT_FILENO);
|
| + FileHandle read_handle = ReadPipeHandle();
|
| + ASSERT_NE(read_handle, STDIN_FILENO);
|
| + ASSERT_NE(read_handle, STDOUT_FILENO);
|
| ASSERT_EQ(STDIN_FILENO, fileno(stdin));
|
|
|
| int rv = fpurge(stdin);
|
| ASSERT_EQ(0, rv) << ErrnoMessage("fpurge");
|
|
|
| - rv = HANDLE_EINTR(dup2(read_fd, STDIN_FILENO));
|
| + rv = HANDLE_EINTR(dup2(read_handle, STDIN_FILENO));
|
| ASSERT_EQ(STDIN_FILENO, rv) << ErrnoMessage("dup2");
|
|
|
| // Move the write pipe to stdout.
|
| - int write_fd = WritePipeFD();
|
| - ASSERT_NE(write_fd, STDIN_FILENO);
|
| - ASSERT_NE(write_fd, STDOUT_FILENO);
|
| + FileHandle write_handle = WritePipeHandle();
|
| + ASSERT_NE(write_handle, STDIN_FILENO);
|
| + ASSERT_NE(write_handle, STDOUT_FILENO);
|
| ASSERT_EQ(STDOUT_FILENO, fileno(stdout));
|
|
|
| // Make a copy of the original stdout file descriptor so that in case there’s
|
| @@ -104,7 +104,7 @@ void MultiprocessExec::MultiprocessChild() {
|
| rv = HANDLE_EINTR(fflush(stdout));
|
| ASSERT_EQ(0, rv) << ErrnoMessage("fflush");
|
|
|
| - rv = HANDLE_EINTR(dup2(write_fd, STDOUT_FILENO));
|
| + rv = HANDLE_EINTR(dup2(write_handle, STDOUT_FILENO));
|
| ASSERT_EQ(STDOUT_FILENO, rv) << ErrnoMessage("dup2");
|
|
|
| CloseMultipleNowOrOnExec(STDERR_FILENO + 1, dup_orig_stdout_fd);
|
|
|