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

Unified Diff: base/sync_socket_posix.cc

Issue 614893004: Refactor AppendToFile and WriteFileDescriptor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nits 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/files/file_util_win.cc ('k') | base/test/trace_to_file.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 86b3c34fcd2f6192b80541f89e26418f1915503d..51b38a586dd72b4ad536695321c8eb1cdfca64e1 100644
--- a/base/sync_socket_posix.cc
+++ b/base/sync_socket_posix.cc
@@ -36,8 +36,9 @@ size_t SendHelper(SyncSocket::Handle handle,
DCHECK_LE(length, kMaxMessageLength);
DCHECK_NE(handle, SyncSocket::kInvalidHandle);
const char* charbuffer = static_cast<const char*>(buffer);
- const int len = WriteFileDescriptor(handle, charbuffer, length);
- return len < 0 ? 0 : static_cast<size_t>(len);
+ return WriteFileDescriptor(handle, charbuffer, length)
+ ? static_cast<size_t>(length)
+ : 0;
}
bool CloseHandle(SyncSocket::Handle handle) {
« no previous file with comments | « base/files/file_util_win.cc ('k') | base/test/trace_to_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698