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

Unified Diff: base/memory/shared_memory_posix.cc

Issue 1138113006: Wrap calls to dup() in shared_memory_posix.cc in HANDLE_EINTR. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/shared_memory_posix.cc
diff --git a/base/memory/shared_memory_posix.cc b/base/memory/shared_memory_posix.cc
index d6c290fa01617581afbaac2a442f7cadc92464a0..2dc08a14ca24ec2c441173b639dd2b5030264389 100644
--- a/base/memory/shared_memory_posix.cc
+++ b/base/memory/shared_memory_posix.cc
@@ -15,6 +15,7 @@
#include "base/files/scoped_file.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
+#include "base/posix/eintr_wrapper.h"
#include "base/process/process_metrics.h"
#include "base/profiler/scoped_tracker.h"
#include "base/safe_strerror_posix.h"
@@ -402,7 +403,7 @@ bool SharedMemory::PrepareMapFile(ScopedFILE fp, ScopedFD readonly_fd) {
}
}
- mapped_file_ = dup(fileno(fp.get()));
+ mapped_file_ = HANDLE_EINTR(dup(fileno(fp.get())));
if (mapped_file_ == -1) {
if (errno == EMFILE) {
LOG(WARNING) << "Shared memory creation failed; out of file descriptors";
@@ -481,7 +482,7 @@ bool SharedMemory::ShareToProcessCommon(ProcessHandle process,
break;
}
- const int new_fd = dup(handle_to_dup);
+ const int new_fd = HANDLE_EINTR(dup(handle_to_dup));
if (new_fd < 0) {
DPLOG(ERROR) << "dup() failed.";
return false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698