Index: util/mach/mach_extensions.cc |
diff --git a/util/mach/mach_extensions.cc b/util/mach/mach_extensions.cc |
index 86ca7bf24b6cb19a80f5461e0d6a011f5324b8e9..97566c97b59dac6facf864f5d3faaf3c44071588 100644 |
--- a/util/mach/mach_extensions.cc |
+++ b/util/mach/mach_extensions.cc |
@@ -17,6 +17,7 @@ |
#include <AvailabilityMacros.h> |
#include <pthread.h> |
+#include "base/mac/mach_logging.h" |
#include "util/mac/mac_util.h" |
namespace crashpad { |
@@ -27,6 +28,17 @@ thread_t MachThreadSelf() { |
return pthread_mach_thread_np(pthread_self()); |
} |
+mach_port_t NewMachPort(mach_port_right_t right) { |
+ mach_port_t port; |
Robert Sesek
2014/12/17 20:06:47
= MACH_PORT_NULL, and then you can just do MACH_LO
|
+ kern_return_t kr = mach_port_allocate(mach_task_self(), right, &port); |
+ if (kr != KERN_SUCCESS) { |
+ MACH_LOG(ERROR, kr) << "mach_port_allocate"; |
+ return MACH_PORT_NULL; |
+ } |
+ |
+ return port; |
+} |
+ |
exception_mask_t ExcMaskAll() { |
// This is necessary because of the way that the kernel validates |
// exception_mask_t arguments to |