aboutsummaryrefslogtreecommitdiff
path: root/src/common/linux/tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/linux/tests')
-rw-r--r--src/common/linux/tests/crash_generator.cc6
-rw-r--r--src/common/linux/tests/crash_generator.h2
2 files changed, 6 insertions, 2 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;
}
diff --git a/src/common/linux/tests/crash_generator.h b/src/common/linux/tests/crash_generator.h
index c88a8920..874b15cd 100644
--- a/src/common/linux/tests/crash_generator.h
+++ b/src/common/linux/tests/crash_generator.h
@@ -70,7 +70,7 @@ class CrashGenerator {
// a signal with number |crash_signal| to the |crash_thread|-th thread.
// Returns true on success.
bool CreateChildCrash(unsigned num_threads, unsigned crash_thread,
- int crash_signal);
+ int crash_signal, pid_t* child_pid);
// Creates |num_threads| threads in the child process.
void CreateThreadsInChildProcess(unsigned num_threads);