aboutsummaryrefslogtreecommitdiff
path: root/src/client/mac/handler
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/mac/handler')
-rw-r--r--src/client/mac/handler/exception_handler.cc1
-rw-r--r--src/client/mac/handler/exception_handler_test.cc10
-rw-r--r--src/client/mac/handler/minidump_generator_test.cc7
3 files changed, 8 insertions, 10 deletions
diff --git a/src/client/mac/handler/exception_handler.cc b/src/client/mac/handler/exception_handler.cc
index 60fde473..fd6ea836 100644
--- a/src/client/mac/handler/exception_handler.cc
+++ b/src/client/mac/handler/exception_handler.cc
@@ -490,7 +490,6 @@ void *ExceptionHandler::WaitForMessage(void *exception_handler_class) {
if (self->use_minidump_write_mutex_)
pthread_mutex_unlock(&self->minidump_write_mutex_);
} else {
-
// When forking a child process with the exception handler installed,
// if the child crashes, it will send the exception back to the parent
// process. The check for task == self_task() ensures that only
diff --git a/src/client/mac/handler/exception_handler_test.cc b/src/client/mac/handler/exception_handler_test.cc
index 59944377..d84f1997 100644
--- a/src/client/mac/handler/exception_handler_test.cc
+++ b/src/client/mac/handler/exception_handler_test.cc
@@ -55,6 +55,7 @@ static void *SleepyFunction(void *) {
while (1) {
sleep(10000);
}
+ return NULL;
}
static void Crasher() {
@@ -77,15 +78,14 @@ bool MDCallback(const char *dump_dir, const char *file_name,
fprintf(stdout, "Minidump: %s\n", path.c_str());
// Indicate that we've handled the callback
- return true;
+ exit(0);
}
int main(int argc, char * const argv[]) {
char buffer[PATH_MAX];
- struct passwd *user = getpwuid(getuid());
// Home dir
- snprintf(buffer, sizeof(buffer), "/Users/%s/Desktop/", user->pw_name);
+ snprintf(buffer, sizeof(buffer), "/tmp/");
string path(buffer);
ExceptionHandler eh(path, NULL, MDCallback, NULL, true);
@@ -97,8 +97,8 @@ int main(int argc, char * const argv[]) {
perror("pthread_create");
}
- // Dump a test
- eh.WriteMinidump();
+// // Dump a test
+// eh.WriteMinidump();
// Test the handler
SoonToCrash();
diff --git a/src/client/mac/handler/minidump_generator_test.cc b/src/client/mac/handler/minidump_generator_test.cc
index 62530832..3a77beb4 100644
--- a/src/client/mac/handler/minidump_generator_test.cc
+++ b/src/client/mac/handler/minidump_generator_test.cc
@@ -45,14 +45,13 @@ static bool doneWritingReport = false;
static void *Reporter(void *) {
char buffer[PATH_MAX];
MinidumpGenerator md;
- struct passwd *user = getpwuid(getuid());
// Write it to the desktop
snprintf(buffer,
sizeof(buffer),
- "/Users/%s/Desktop/test.dmp",
- user->pw_name);
-
+ "/tmp/test.dmp");
+
+
fprintf(stdout, "Writing %s\n", buffer);
unlink(buffer);
md.Write(buffer);