From 80f50467c301d9ef0c2e093c4c004c59dfe30cea Mon Sep 17 00:00:00 2001 From: Scott Graham Date: Thu, 22 Oct 2015 14:17:03 -0700 Subject: [PATCH] Fix Mac after FileOperationResult change Oops, forgot to test Mac, sorry. R=mark@chromium.org Review URL: https://codereview.chromium.org/1409973004 . --- util/file/file_io_posix.cc | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/util/file/file_io_posix.cc b/util/file/file_io_posix.cc index 866b1ab1..ce08a396 100644 --- a/util/file/file_io_posix.cc +++ b/util/file/file_io_posix.cc @@ -28,9 +28,9 @@ namespace { struct ReadTraits { using VoidBufferType = void*; using CharBufferType = char*; - static FileOperationResult Operate(int fd, - CharBufferType buffer, - size_t size) { + static crashpad::FileOperationResult Operate(int fd, + CharBufferType buffer, + size_t size) { return read(fd, buffer, size); } }; @@ -38,23 +38,22 @@ struct ReadTraits { struct WriteTraits { using VoidBufferType = const void*; using CharBufferType = const char*; - static FileOperationResult Operate(int fd, - CharBufferType buffer, - size_t size) { + static crashpad::FileOperationResult Operate(int fd, + CharBufferType buffer, + size_t size) { return write(fd, buffer, size); } }; template -FileOperationResult ReadOrWrite(int fd, - typename Traits::VoidBufferType buffer, - size_t size) { +crashpad::FileOperationResult +ReadOrWrite(int fd, typename Traits::VoidBufferType buffer, size_t size) { typename Traits::CharBufferType buffer_c = reinterpret_cast(buffer); - FileOperationResult total_bytes = 0; + crashpad::FileOperationResult total_bytes = 0; while (size > 0) { - FileOperationResult bytes = + crashpad::FileOperationResult bytes = HANDLE_EINTR(Traits::Operate(fd, buffer_c, size)); if (bytes < 0) { return bytes;