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

Unified Diff: util/file/file_io_win.cc

Issue 880763002: Reorganize Multiprocess and implement for Windows (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: . Created 5 years, 11 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
Index: util/file/file_io_win.cc
diff --git a/util/file/file_io_win.cc b/util/file/file_io_win.cc
index 861f15acc64e2243c2b5d024bc68f7b947ff15e4..264cc4342e026f40dd2051637c6c6279d4277414 100644
--- a/util/file/file_io_win.cc
+++ b/util/file/file_io_win.cc
@@ -44,7 +44,12 @@ ssize_t ReadFile(FileHandle file, void* buffer, size_t size) {
while (size_dword > 0) {
DWORD bytes_read;
BOOL success = ::ReadFile(file, buffer_c, size_dword, &bytes_read, nullptr);
- if (!success && GetLastError() != ERROR_MORE_DATA) {
+ if (!success && GetLastError() == ERROR_BROKEN_PIPE) {
Mark Mentovai 2015/01/28 19:58:27 A light restructuring to keep rechecking the same
scottmg 2015/01/28 22:14:57 Done.
+ // When reading a pipe and the write handle has been closed, ReadFile
+ // fails with ERROR_BROKEN_PIPE, but only once all pending data has been
+ // read.
+ break;
+ } else if (!success && GetLastError() != ERROR_MORE_DATA) {
return -1;
} else if (success && bytes_read == 0 &&
GetFileType(file) != FILE_TYPE_PIPE) {

Powered by Google App Engine
This is Rietveld 408576698