crash-reporter: Avoid using system to invoke core2md
Change-Id: I1fc0b4dd6e4e84cb999ba61fedd43fc74a8fa1ba
BUG=6941
TEST=bvts
Review URL: http://codereview.chromium.org/3755011
diff --git a/crash_reporter/user_collector.h b/crash_reporter/user_collector.h
index 484445f..7d6c711 100644
--- a/crash_reporter/user_collector.h
+++ b/crash_reporter/user_collector.h
@@ -6,6 +6,7 @@
#define _CRASH_REPORTER_USER_COLLECTOR_H_
#include <string>
+#include <vector>
#include "crash-reporter/crash_collector.h"
#include "gtest/gtest_prod.h" // for FRIEND_TEST
@@ -51,6 +52,7 @@
FRIEND_TEST(UserCollectorTest, CopyOffProcFilesBadPath);
FRIEND_TEST(UserCollectorTest, CopyOffProcFilesBadPid);
FRIEND_TEST(UserCollectorTest, CopyOffProcFilesOK);
+ FRIEND_TEST(UserCollectorTest, ForkExecAndPipe);
FRIEND_TEST(UserCollectorTest, GetIdFromStatus);
FRIEND_TEST(UserCollectorTest, GetProcessPath);
FRIEND_TEST(UserCollectorTest, GetSymlinkTarget);
@@ -66,6 +68,8 @@
kIdMax
};
+ static const int kForkProblem = 255;
+
std::string GetPattern(bool enabled) const;
bool SetUpInternal(bool enabled);
@@ -86,6 +90,8 @@
bool GetCreatedCrashDirectory(pid_t pid,
FilePath *crash_file_path);
bool CopyStdinToCoreFile(const FilePath &core_path);
+ int ForkExecAndPipe(std::vector<const char *> &arguments,
+ const char *output_file);
bool ConvertCoreToMinidump(const FilePath &core_path,
const FilePath &procfs_directory,
const FilePath &minidump_path,