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

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

Issue 10907248: Don't use TEMP_FAILURE_RETRY macro with inet_addr (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Modify change list to remove description of potential infinite loop. Not sure it is really possible. Created 8 years, 3 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 | « runtime/bin/socket_linux.cc ('k') | no next file » | 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 <errno.h> 5 #include <errno.h>
6 #include <stdio.h> 6 #include <stdio.h>
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <string.h> 8 #include <string.h>
9 #include <unistd.h> 9 #include <unistd.h>
10 10
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 return buffer; 169 return buffer;
170 } 170 }
171 171
172 172
173 intptr_t ServerSocket::CreateBindListen(const char* host, 173 intptr_t ServerSocket::CreateBindListen(const char* host,
174 intptr_t port, 174 intptr_t port,
175 intptr_t backlog) { 175 intptr_t backlog) {
176 intptr_t fd; 176 intptr_t fd;
177 struct sockaddr_in server_address; 177 struct sockaddr_in server_address;
178 178
179 in_addr_t s_addr = TEMP_FAILURE_RETRY(inet_addr(host)); 179 in_addr_t s_addr = inet_addr(host);
180 if (s_addr == INADDR_NONE) { 180 if (s_addr == INADDR_NONE) {
181 return -5; 181 return -5;
182 } 182 }
183 183
184 fd = TEMP_FAILURE_RETRY(socket(AF_INET, SOCK_STREAM, 0)); 184 fd = TEMP_FAILURE_RETRY(socket(AF_INET, SOCK_STREAM, 0));
185 if (fd < 0) { 185 if (fd < 0) {
186 fprintf(stderr, "Error CreateBind: %s\n", strerror(errno)); 186 fprintf(stderr, "Error CreateBind: %s\n", strerror(errno));
187 return -1; 187 return -1;
188 } 188 }
189 189
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 // error. We got woken up from the poll on the listening socket, 226 // error. We got woken up from the poll on the listening socket,
227 // but there is no connection ready to be accepted. 227 // but there is no connection ready to be accepted.
228 ASSERT(kTemporaryFailure != -1); 228 ASSERT(kTemporaryFailure != -1);
229 socket = kTemporaryFailure; 229 socket = kTemporaryFailure;
230 } 230 }
231 } else { 231 } else {
232 FDUtils::SetNonBlocking(socket); 232 FDUtils::SetNonBlocking(socket);
233 } 233 }
234 return socket; 234 return socket;
235 } 235 }
OLDNEW
« no previous file with comments | « runtime/bin/socket_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698