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

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

Issue 600273004: Remove the assumption that stat64 and lstat64 cannot return EINTR on Linux (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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/file_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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 int err = 0; 174 int err = 0;
175 VOID_NO_RETRY_EXPECTED(getsockopt( 175 VOID_NO_RETRY_EXPECTED(getsockopt(
176 fd, SOL_SOCKET, SO_ERROR, &err, reinterpret_cast<socklen_t*>(&len))); 176 fd, SOL_SOCKET, SO_ERROR, &err, reinterpret_cast<socklen_t*>(&len)));
177 errno = err; 177 errno = err;
178 os_error->SetCodeAndMessage(OSError::kSystem, errno); 178 os_error->SetCodeAndMessage(OSError::kSystem, errno);
179 } 179 }
180 180
181 181
182 int Socket::GetType(intptr_t fd) { 182 int Socket::GetType(intptr_t fd) {
183 struct stat64 buf; 183 struct stat64 buf;
184 int result = NO_RETRY_EXPECTED(fstat64(fd, &buf)); 184 int result = TEMP_FAILURE_RETRY(fstat64(fd, &buf));
185 if (result == -1) return -1; 185 if (result == -1) return -1;
186 if (S_ISCHR(buf.st_mode)) return File::kTerminal; 186 if (S_ISCHR(buf.st_mode)) return File::kTerminal;
187 if (S_ISFIFO(buf.st_mode)) return File::kPipe; 187 if (S_ISFIFO(buf.st_mode)) return File::kPipe;
188 if (S_ISREG(buf.st_mode)) return File::kFile; 188 if (S_ISREG(buf.st_mode)) return File::kFile;
189 return File::kOther; 189 return File::kOther;
190 } 190 }
191 191
192 192
193 intptr_t Socket::GetStdioHandle(intptr_t num) { 193 intptr_t Socket::GetStdioHandle(intptr_t num) {
194 return num; 194 return num;
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 mreq.gr_interface = interfaceIndex; 552 mreq.gr_interface = interfaceIndex;
553 memmove(&mreq.gr_group, &addr->ss, SocketAddress::GetAddrLength(addr)); 553 memmove(&mreq.gr_group, &addr->ss, SocketAddress::GetAddrLength(addr));
554 return NO_RETRY_EXPECTED( 554 return NO_RETRY_EXPECTED(
555 setsockopt(fd, proto, MCAST_LEAVE_GROUP, &mreq, sizeof(mreq))) == 0; 555 setsockopt(fd, proto, MCAST_LEAVE_GROUP, &mreq, sizeof(mreq))) == 0;
556 } 556 }
557 557
558 } // namespace bin 558 } // namespace bin
559 } // namespace dart 559 } // namespace dart
560 560
561 #endif // defined(TARGET_OS_LINUX) 561 #endif // defined(TARGET_OS_LINUX)
OLDNEW
« no previous file with comments | « runtime/bin/file_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698