aboutsummaryrefslogtreecommitdiff
path: root/src/common/linux/tests/crash_generator.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/linux/tests/crash_generator.cc')
-rw-r--r--src/common/linux/tests/crash_generator.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/common/linux/tests/crash_generator.cc b/src/common/linux/tests/crash_generator.cc
index fd96e6ca..7274acf9 100644
--- a/src/common/linux/tests/crash_generator.cc
+++ b/src/common/linux/tests/crash_generator.cc
@@ -144,7 +144,8 @@ bool CrashGenerator::SetCoreFileSizeLimit(rlim_t limit) const {
}
bool CrashGenerator::CreateChildCrash(
- unsigned num_threads, unsigned crash_thread, int crash_signal) {
+ unsigned num_threads, unsigned crash_thread, int crash_signal,
+ pid_t* child_pid) {
if (num_threads == 0 || crash_thread >= num_threads)
return false;
@@ -178,6 +179,9 @@ bool CrashGenerator::CreateChildCrash(
perror("CrashGenerator: Child process not killed by the expected signal");
return false;
}
+
+ if (child_pid)
+ *child_pid = pid;
return true;
}