Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(511)

Side by Side Diff: runtime/bin/eventhandler_macos.cc

Issue 12178025: - Avoid warnings when the result of TEMP_FAILURE_RETRY is unused. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/bin/process_macos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "bin/eventhandler.h" 5 #include "bin/eventhandler.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <pthread.h> 8 #include <pthread.h>
9 #include <stdio.h> 9 #include <stdio.h>
10 #include <string.h> 10 #include <string.h>
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 struct kevent event; 128 struct kevent event;
129 EV_SET(&event, interrupt_fds_[0], EVFILT_READ, EV_ADD, 0, 0, NULL); 129 EV_SET(&event, interrupt_fds_[0], EVFILT_READ, EV_ADD, 0, 0, NULL);
130 int status = TEMP_FAILURE_RETRY(kevent(kqueue_fd_, &event, 1, NULL, 0, NULL)); 130 int status = TEMP_FAILURE_RETRY(kevent(kqueue_fd_, &event, 1, NULL, 0, NULL));
131 if (status == -1) { 131 if (status == -1) {
132 FATAL1("Failed adding interrupt fd to kqueue: %s\n", strerror(errno)); 132 FATAL1("Failed adding interrupt fd to kqueue: %s\n", strerror(errno));
133 } 133 }
134 } 134 }
135 135
136 136
137 EventHandlerImplementation::~EventHandlerImplementation() { 137 EventHandlerImplementation::~EventHandlerImplementation() {
138 TEMP_FAILURE_RETRY(close(interrupt_fds_[0])); 138 VOID_TEMP_FAILURE_RETRY(close(interrupt_fds_[0]));
139 TEMP_FAILURE_RETRY(close(interrupt_fds_[1])); 139 VOID_TEMP_FAILURE_RETRY(close(interrupt_fds_[1]));
140 } 140 }
141 141
142 142
143 SocketData* EventHandlerImplementation::GetSocketData(intptr_t fd) { 143 SocketData* EventHandlerImplementation::GetSocketData(intptr_t fd) {
144 ASSERT(fd >= 0); 144 ASSERT(fd >= 0);
145 HashMap::Entry* entry = socket_map_.Lookup( 145 HashMap::Entry* entry = socket_map_.Lookup(
146 GetHashmapKeyFromFd(fd), GetHashmapHashFromFd(fd), true); 146 GetHashmapKeyFromFd(fd), GetHashmapHashFromFd(fd), true);
147 ASSERT(entry != NULL); 147 ASSERT(entry != NULL);
148 SocketData* sd = reinterpret_cast<SocketData*>(entry->value); 148 SocketData* sd = reinterpret_cast<SocketData*>(entry->value);
149 if (sd == NULL) { 149 if (sd == NULL) {
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 void* EventHandlerImplementation::GetHashmapKeyFromFd(intptr_t fd) { 408 void* EventHandlerImplementation::GetHashmapKeyFromFd(intptr_t fd) {
409 // The hashmap does not support keys with value 0. 409 // The hashmap does not support keys with value 0.
410 return reinterpret_cast<void*>(fd + 1); 410 return reinterpret_cast<void*>(fd + 1);
411 } 411 }
412 412
413 413
414 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) { 414 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) {
415 // The hashmap does not support keys with value 0. 415 // The hashmap does not support keys with value 0.
416 return dart::Utils::WordHash(fd + 1); 416 return dart::Utils::WordHash(fd + 1);
417 } 417 }
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/process_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698