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

Unified Diff: base/sync_socket_posix.cc

Issue 6549037: Dup command-buffer SHM handle before auto-closing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/shared_memory_posix.cc ('k') | ppapi/proxy/ppb_context_3d_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/sync_socket_posix.cc
diff --git a/base/sync_socket_posix.cc b/base/sync_socket_posix.cc
index c2020c2ad632f93cabc2fb755608218a9de59ec2..91467b189c72d69ac604130ec7f96dba951faa18 100644
--- a/base/sync_socket_posix.cc
+++ b/base/sync_socket_posix.cc
@@ -63,10 +63,14 @@ bool SyncSocket::CreatePair(SyncSocket* pair[2]) {
return true;
cleanup:
- if (handles[0] != kInvalidHandle)
- (void) close(handles[0]);
- if (handles[1] != kInvalidHandle)
- (void) close(handles[1]);
+ if (handles[0] != kInvalidHandle) {
+ if (HANDLE_EINTR(close(handles[0])) < 0)
+ PLOG(ERROR) << "close";
+ }
+ if (handles[1] != kInvalidHandle) {
+ if (HANDLE_EINTR(close(handles[1])) < 0)
+ PLOG(ERROR) << "close";
+ }
delete tmp_sockets[0];
delete tmp_sockets[1];
return false;
@@ -76,7 +80,9 @@ bool SyncSocket::Close() {
if (handle_ == kInvalidHandle) {
return false;
}
- int retval = close(handle_);
+ int retval = HANDLE_EINTR(close(handle_));
+ if (retval < 0)
+ PLOG(ERROR) << "close";
handle_ = kInvalidHandle;
return (retval == 0);
}
« no previous file with comments | « base/shared_memory_posix.cc ('k') | ppapi/proxy/ppb_context_3d_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698