Index: sandbox/linux/tests/test_utils.cc |
diff --git a/sandbox/linux/tests/test_utils.cc b/sandbox/linux/tests/test_utils.cc |
index 398654bcb8127f7905a381226acea72586ee3fbb..6000b8aa64f207ded7e326200567a4fb4b800e25 100644 |
--- a/sandbox/linux/tests/test_utils.cc |
+++ b/sandbox/linux/tests/test_utils.cc |
@@ -28,4 +28,16 @@ bool TestUtils::CurrentProcessHasChildren() { |
} |
} |
+void TestUtils::HandlePostForkReturn(pid_t pid) { |
+ const int kChildExitCode = 1; |
+ if (pid > 0) { |
+ int status = 0; |
+ PCHECK(pid == HANDLE_EINTR(waitpid(pid, &status, 0))); |
+ CHECK(WIFEXITED(status)); |
+ CHECK_EQ(kChildExitCode, WEXITSTATUS(status)); |
+ } else if (pid == 0) { |
+ _exit(kChildExitCode); |
+ } |
+} |
+ |
} // namespace sandbox |