summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKuba Mracek <mracek@apple.com>2017-08-07 18:07:20 +0000
committerKuba Mracek <mracek@apple.com>2017-08-07 18:07:20 +0000
commit06f7854c1d782fe072c1442dbaa4d9bf75b1bfd7 (patch)
treeebe2aab0f07e1362720cfa12df2e8ed049fc854c /lib
parentacb113dd88f5bdca20e42d611981fb133d40d292 (diff)
[sanitizer] Remove use of task_for_pid from sanitizer_stoptheworld_mac.cc
Using task_for_pid to get the "self" task is not necessary, and it can fail (e.g. for sandboxed processes). Let's just use mach_task_self(). Differential Revision: https://reviews.llvm.org/D36284 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@310271 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/sanitizer_common/sanitizer_stoptheworld_mac.cc10
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/sanitizer_common/sanitizer_stoptheworld_mac.cc b/lib/sanitizer_common/sanitizer_stoptheworld_mac.cc
index 0c27c472f..d84ebef3b 100644
--- a/lib/sanitizer_common/sanitizer_stoptheworld_mac.cc
+++ b/lib/sanitizer_common/sanitizer_stoptheworld_mac.cc
@@ -55,17 +55,9 @@ void RunThread(void *arg) {
struct RunThreadArgs *run_args = (struct RunThreadArgs *)arg;
SuspendedThreadsListMac suspended_threads_list;
- mach_port_t task;
- kern_return_t err = task_for_pid(mach_task_self(), internal_getpid(), &task);
- if (err != KERN_SUCCESS) {
- VReport(1, "Getting task from pid failed (errno %d).\n", err);
- return;
- }
-
thread_array_t threads;
mach_msg_type_number_t num_threads;
-
- err = task_threads(task, &threads, &num_threads);
+ kern_return_t err = task_threads(mach_task_self(), &threads, &num_threads);
if (err != KERN_SUCCESS) {
VReport(1, "Failed to get threads for task (errno %d).\n", err);
return;