Index: util/file/file_writer.cc |
diff --git a/util/file/file_writer.cc b/util/file/file_writer.cc |
index 1b6ba0d4a1079ad87d3c5e89fca22a97404eb604..aedcd5dce3bb01e853a7c67c82749ebf6f241658 100644 |
--- a/util/file/file_writer.cc |
+++ b/util/file/file_writer.cc |
@@ -19,6 +19,8 @@ |
#include <limits.h> |
#include "base/logging.h" |
+#include "base/numerics/safe_conversions.h" |
+#include "build/build_config.h" |
#if defined(OS_POSIX) |
#include <sys/uio.h> |
@@ -46,18 +48,7 @@ WeakFileHandleFileWriter::~WeakFileHandleFileWriter() { |
bool WeakFileHandleFileWriter::Write(const void* data, size_t size) { |
DCHECK_NE(file_handle_, kInvalidFileHandle); |
- |
- // TODO(mark): Write no more than SSIZE_MAX bytes in a single call. |
- ssize_t written = WriteFile(file_handle_, data, size); |
- if (written < 0) { |
- PLOG(ERROR) << "write"; |
- return false; |
- } else if (written == 0) { |
- LOG(ERROR) << "write: returned 0"; |
- return false; |
- } |
- |
- return true; |
+ return LoggingWriteFile(file_handle_, data, size); |
} |
bool WeakFileHandleFileWriter::WriteIoVec(std::vector<WritableIoVec>* iovecs) { |