Fix minor bug -- if ExecDeathTestChildMain() ever returns, we should exit

with a non-zero status.

PiperOrigin-RevId: 518306642
Change-Id: I72fb2764e477acb0362593c63f7748c4f64db0c6
This commit is contained in:
Abseil Team 2023-03-21 10:06:47 -07:00 committed by Copybara-Service
parent e9faae170f
commit 974e18ee6f

View File

@ -1328,8 +1328,7 @@ static pid_t ExecDeathTestSpawnChild(char* const* argv, int close_fd) {
#endif // GTEST_HAS_CLONE #endif // GTEST_HAS_CLONE
if (use_fork && (child_pid = fork()) == 0) { if (use_fork && (child_pid = fork()) == 0) {
ExecDeathTestChildMain(&args); _exit(ExecDeathTestChildMain(&args));
_exit(0);
} }
#endif // GTEST_OS_QNX #endif // GTEST_OS_QNX
#ifdef GTEST_OS_LINUX #ifdef GTEST_OS_LINUX