Fix linux compile errors for some systems.
Codereview: https://breakpad.appspot.com/460002/ Patch by: jakerr@google.com git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1055 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
47d9afa176
commit
a56db25fed
3 changed files with 13 additions and 11 deletions
|
@ -37,7 +37,7 @@ class CrashGenerationServer;
|
|||
class ClientInfo {
|
||||
public:
|
||||
ClientInfo(pid_t pid, CrashGenerationServer* crash_server)
|
||||
: crash_server_(crash_server_),
|
||||
: crash_server_(crash_server),
|
||||
pid_(pid) {}
|
||||
|
||||
CrashGenerationServer* crash_server() const { return crash_server_; }
|
||||
|
|
|
@ -60,8 +60,8 @@ const int kGUIDStringSize = 37;
|
|||
|
||||
void sigchld_handler(int signo) { }
|
||||
|
||||
int CreateTMPFile(const std::string& dir, std::string* path) {
|
||||
std::string file = dir + "/exception-handler-unittest.XXXXXX";
|
||||
int CreateTMPFile(const string& dir, string* path) {
|
||||
string file = dir + "/exception-handler-unittest.XXXXXX";
|
||||
const char* c_file = file.c_str();
|
||||
// Copy that string, mkstemp needs a C string it can modify.
|
||||
char* c_path = strdup(c_file);
|
||||
|
@ -98,7 +98,7 @@ void WaitForProcessToTerminate(pid_t process_id, int expected_status) {
|
|||
}
|
||||
|
||||
// Reads the minidump path sent over the pipe |fd| and sets it in |path|.
|
||||
void ReadMinidumpPathFromPipe(int fd, std::string* path) {
|
||||
void ReadMinidumpPathFromPipe(int fd, string* path) {
|
||||
struct pollfd pfd;
|
||||
memset(&pfd, 0, sizeof(pfd));
|
||||
pfd.fd = fd;
|
||||
|
@ -133,7 +133,7 @@ TEST(ExceptionHandlerTest, SimpleWithPath) {
|
|||
|
||||
TEST(ExceptionHandlerTest, SimpleWithFD) {
|
||||
AutoTempDir temp_dir;
|
||||
std::string path;
|
||||
string path;
|
||||
const int fd = CreateTMPFile(temp_dir.path(), &path);
|
||||
ExceptionHandler handler(MinidumpDescriptor(fd), NULL, NULL, NULL, true, -1);
|
||||
close(fd);
|
||||
|
@ -159,7 +159,7 @@ void ChildCrash(bool use_fd) {
|
|||
AutoTempDir temp_dir;
|
||||
int fds[2] = {0};
|
||||
int minidump_fd = -1;
|
||||
std::string minidump_path;
|
||||
string minidump_path;
|
||||
if (use_fd) {
|
||||
minidump_fd = CreateTMPFile(temp_dir.path(), &minidump_path);
|
||||
} else {
|
||||
|
@ -169,7 +169,7 @@ void ChildCrash(bool use_fd) {
|
|||
const pid_t child = fork();
|
||||
if (child == 0) {
|
||||
{
|
||||
scoped_ptr<ExceptionHandler> handler;
|
||||
google_breakpad::scoped_ptr<ExceptionHandler> handler;
|
||||
if (use_fd) {
|
||||
handler.reset(new ExceptionHandler(MinidumpDescriptor(minidump_fd),
|
||||
NULL, NULL, NULL, true, -1));
|
||||
|
@ -238,6 +238,7 @@ static bool FilterCallbackReturnTrue(void* context) {
|
|||
// redelivered to this handler. If the child dies with SIGSEGV then it wasn't.
|
||||
static void RaiseSIGKILL(int sig) {
|
||||
raise(SIGKILL);
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool InstallRaiseSIGKILL() {
|
||||
|
@ -917,7 +918,7 @@ TEST(ExceptionHandlerTest, WriteMinidumpExceptionStream) {
|
|||
|
||||
TEST(ExceptionHandlerTest, GenerateMultipleDumpsWithFD) {
|
||||
AutoTempDir temp_dir;
|
||||
std::string path;
|
||||
string path;
|
||||
const int fd = CreateTMPFile(temp_dir.path(), &path);
|
||||
ExceptionHandler handler(MinidumpDescriptor(fd), NULL, NULL, NULL, false, -1);
|
||||
ASSERT_TRUE(handler.WriteMinidump());
|
||||
|
@ -942,7 +943,7 @@ TEST(ExceptionHandlerTest, GenerateMultipleDumpsWithPath) {
|
|||
struct stat st;
|
||||
ASSERT_EQ(0, stat(minidump_1.path(), &st));
|
||||
ASSERT_GT(st.st_size, 0U);
|
||||
std::string minidump_1_path(minidump_1.path());
|
||||
string minidump_1_path(minidump_1.path());
|
||||
// Check it is a valid minidump.
|
||||
Minidump minidump1(minidump_1_path);
|
||||
ASSERT_TRUE(minidump1.Read());
|
||||
|
@ -953,7 +954,7 @@ TEST(ExceptionHandlerTest, GenerateMultipleDumpsWithPath) {
|
|||
const MinidumpDescriptor& minidump_2 = handler.minidump_descriptor();
|
||||
ASSERT_EQ(0, stat(minidump_2.path(), &st));
|
||||
ASSERT_GT(st.st_size, 0U);
|
||||
std::string minidump_2_path(minidump_2.path());
|
||||
string minidump_2_path(minidump_2.path());
|
||||
// Check it is a valid minidump.
|
||||
Minidump minidump2(minidump_2_path);
|
||||
ASSERT_TRUE(minidump2.Read());
|
||||
|
|
|
@ -80,7 +80,8 @@ typedef enum {
|
|||
MD_EXCEPTION_CODE_LIN_SIGIO = 29, /* I/O now possible (4.2 BSD) */
|
||||
MD_EXCEPTION_CODE_LIN_SIGPWR = 30, /* Power failure restart (System V) */
|
||||
MD_EXCEPTION_CODE_LIN_SIGSYS = 31, /* Bad system call */
|
||||
MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED = -1 /* No exception, dump requested */
|
||||
MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED = 0xFFFFFFFF /* No exception,
|
||||
dump requested. */
|
||||
} MDExceptionCodeLinux;
|
||||
|
||||
#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_LINUX_H__ */
|
||||
|
|
Loading…
Reference in a new issue