diff options
author | qsr@chromium.org <qsr@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2011-10-24 14:58:12 +0000 |
---|---|---|
committer | qsr@chromium.org <qsr@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2011-10-24 14:58:12 +0000 |
commit | 09de69eca1bc82fe4851d48baf4af5e9a1b9d0fa (patch) | |
tree | f72415ce84145a1aebbcaffe4e62ada073eefa69 /src/client/mac/handler/minidump_generator.cc | |
parent | Upstream fix for compiling of breakpad with gcc-4.6. Remove an unnecessary (diff) | |
download | breakpad-09de69eca1bc82fe4851d48baf4af5e9a1b9d0fa.tar.xz |
Do not use mach_vm.h on iOS.
mach_vm.h has been removed from iOS5. Use #define to use vm_ replacement of
mach_vm_ functions on iOS.
Do not use mach_vm_allocate -> use a stack variable instead.
Review URL: http://breakpad.appspot.com/321001
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@879 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/mac/handler/minidump_generator.cc')
-rw-r--r-- | src/client/mac/handler/minidump_generator.cc | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/client/mac/handler/minidump_generator.cc b/src/client/mac/handler/minidump_generator.cc index f245f66d..68d7903a 100644 --- a/src/client/mac/handler/minidump_generator.cc +++ b/src/client/mac/handler/minidump_generator.cc @@ -31,7 +31,6 @@ #include <cstdio> #include <mach/host_info.h> -#include <mach/mach_vm.h> #include <mach/vm_statistics.h> #include <mach-o/dyld.h> #include <mach-o/loader.h> @@ -1378,19 +1377,11 @@ bool MinidumpGenerator::WriteMiscInfoStream(MDRawDirectory *misc_info_stream) { int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, static_cast<int>(info_ptr->process_id) }; u_int mibsize = static_cast<u_int>(sizeof(mib) / sizeof(mib[0])); - size_t size; - if (!sysctl(mib, mibsize, NULL, &size, NULL, 0)) { - mach_vm_address_t addr; - if (mach_vm_allocate(mach_task_self(), - &addr, - size, - true) == KERN_SUCCESS) { - struct kinfo_proc *proc = (struct kinfo_proc *)addr; - if (!sysctl(mib, mibsize, proc, &size, NULL, 0)) - info_ptr->process_create_time = - static_cast<u_int32_t>(proc->kp_proc.p_starttime.tv_sec); - mach_vm_deallocate(mach_task_self(), addr, size); - } + struct kinfo_proc proc; + size_t size = sizeof(proc); + if (sysctl(mib, mibsize, &proc, &size, NULL, 0) == 0) { + info_ptr->process_create_time = + static_cast<u_int32_t>(proc.kp_proc.p_starttime.tv_sec); } // Speed |