| 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_LINUX) | 6 #if defined(TARGET_OS_LINUX) |
| 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 30 matching lines...) Expand all Loading... |
| 41 // Sync message. Not yet implemented. | 41 // Sync message. Not yet implemented. |
| 42 UNIMPLEMENTED(); | 42 UNIMPLEMENTED(); |
| 43 } else { | 43 } else { |
| 44 Log::Print("unexpected: receiving debugger connection event.\n"); | 44 Log::Print("unexpected: receiving debugger connection event.\n"); |
| 45 UNIMPLEMENTED(); | 45 UNIMPLEMENTED(); |
| 46 } | 46 } |
| 47 } | 47 } |
| 48 | 48 |
| 49 | 49 |
| 50 void DebuggerConnectionImpl::Handler(uword args) { | 50 void DebuggerConnectionImpl::Handler(uword args) { |
| 51 static const intptr_t kMaxEvents = 4; | 51 static const int kMaxEvents = 4; |
| 52 struct epoll_event events[kMaxEvents]; | 52 struct epoll_event events[kMaxEvents]; |
| 53 while (1) { | 53 while (1) { |
| 54 const int no_timeout = -1; | 54 const int no_timeout = -1; |
| 55 intptr_t result = TEMP_FAILURE_RETRY( | 55 intptr_t result = TEMP_FAILURE_RETRY( |
| 56 epoll_wait(epoll_fd_, events, kMaxEvents, no_timeout)); | 56 epoll_wait(epoll_fd_, events, kMaxEvents, no_timeout)); |
| 57 ASSERT(EAGAIN == EWOULDBLOCK); | 57 ASSERT(EAGAIN == EWOULDBLOCK); |
| 58 if (result == -1) { | 58 if (result == -1) { |
| 59 if (errno != EWOULDBLOCK) { | 59 if (errno != EWOULDBLOCK) { |
| 60 perror("epoll_wait failed"); | 60 perror("epoll_wait failed"); |
| 61 } | 61 } |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 121 |
| 122 | 122 |
| 123 intptr_t DebuggerConnectionImpl::Receive(intptr_t socket, char* buf, int len) { | 123 intptr_t DebuggerConnectionImpl::Receive(intptr_t socket, char* buf, int len) { |
| 124 return TEMP_FAILURE_RETRY(read(socket, buf, len)); | 124 return TEMP_FAILURE_RETRY(read(socket, buf, len)); |
| 125 } | 125 } |
| 126 | 126 |
| 127 } // namespace bin | 127 } // namespace bin |
| 128 } // namespace dart | 128 } // namespace dart |
| 129 | 129 |
| 130 #endif // defined(TARGET_OS_LINUX) | 130 #endif // defined(TARGET_OS_LINUX) |
| OLD | NEW |