Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Unified Diff: util/test/multiprocess_exec_posix.cc

Issue 880763002: Reorganize Multiprocess and implement for Windows (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: fixes 2 Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « util/test/multiprocess_exec.cc ('k') | util/test/multiprocess_exec_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..48a91ffbfcf25541074e33162465caf594ef68e0 100644
--- a/util/test/multiprocess_exec.cc
+++ b/util/test/multiprocess_exec_posix.cc
@@ -17,6 +17,7 @@
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
#include "base/posix/eintr_wrapper.h"
#include "gtest/gtest.h"
@@ -72,21 +73,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 +105,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);
« no previous file with comments | « util/test/multiprocess_exec.cc ('k') | util/test/multiprocess_exec_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698