| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/globals.h" | 5 #include "platform/globals.h" |
| 6 #if defined(TARGET_OS_MACOS) | 6 #if defined(TARGET_OS_MACOS) |
| 7 | 7 |
| 8 #include <errno.h> // NOLINT | 8 #include <errno.h> // NOLINT |
| 9 #include <stdio.h> // NOLINT | 9 #include <stdio.h> // NOLINT |
| 10 #include <stdlib.h> // NOLINT | 10 #include <stdlib.h> // NOLINT |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 char error_message[kBufferSize]; | 162 char error_message[kBufferSize]; |
| 163 strerror_r(errno, error_message, kBufferSize); | 163 strerror_r(errno, error_message, kBufferSize); |
| 164 FATAL1("Failed adding listener socket to kqueue: %s\n", error_message); | 164 FATAL1("Failed adding listener socket to kqueue: %s\n", error_message); |
| 165 } | 165 } |
| 166 } | 166 } |
| 167 | 167 |
| 168 | 168 |
| 169 void DebuggerConnectionImpl::StartHandler(int port_number) { | 169 void DebuggerConnectionImpl::StartHandler(int port_number) { |
| 170 ASSERT(DebuggerConnectionHandler::listener_fd_ != -1); | 170 ASSERT(DebuggerConnectionHandler::listener_fd_ != -1); |
| 171 SetupPollQueue(); | 171 SetupPollQueue(); |
| 172 int result = dart::Thread::Start(&DebuggerConnectionImpl::Handler, 0); | 172 int result = Thread::Start(&DebuggerConnectionImpl::Handler, 0); |
| 173 if (result != 0) { | 173 if (result != 0) { |
| 174 FATAL1("Failed to start debugger connection handler thread: %d\n", result); | 174 FATAL1("Failed to start debugger connection handler thread: %d\n", result); |
| 175 } | 175 } |
| 176 } | 176 } |
| 177 | 177 |
| 178 | 178 |
| 179 intptr_t DebuggerConnectionImpl::Send(intptr_t socket, | 179 intptr_t DebuggerConnectionImpl::Send(intptr_t socket, |
| 180 const char* buf, | 180 const char* buf, |
| 181 int len) { | 181 int len) { |
| 182 return TEMP_FAILURE_RETRY(write(socket, buf, len)); | 182 return TEMP_FAILURE_RETRY(write(socket, buf, len)); |
| 183 } | 183 } |
| 184 | 184 |
| 185 | 185 |
| 186 intptr_t DebuggerConnectionImpl::Receive(intptr_t socket, char* buf, int len) { | 186 intptr_t DebuggerConnectionImpl::Receive(intptr_t socket, char* buf, int len) { |
| 187 return TEMP_FAILURE_RETRY(read(socket, buf, len)); | 187 return TEMP_FAILURE_RETRY(read(socket, buf, len)); |
| 188 } | 188 } |
| 189 | 189 |
| 190 } // namespace bin | 190 } // namespace bin |
| 191 } // namespace dart | 191 } // namespace dart |
| 192 | 192 |
| 193 #endif // defined(TARGET_OS_MACOS) | 193 #endif // defined(TARGET_OS_MACOS) |
| OLD | NEW |