diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2019-12-05 15:12:59 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2019-12-05 15:12:59 +0900 |
commit | b8cf34c691623e4ec329053cbbf68522a855882d (patch) | |
tree | 34da08632a99677f6b79ecb65e5b655a5b69a67f /boost/beast/core/impl/file_win32.ipp | |
parent | 3fdc3e5ee96dca5b11d1694975a65200787eab86 (diff) | |
download | boost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.gz boost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.bz2 boost-b8cf34c691623e4ec329053cbbf68522a855882d.zip |
Imported Upstream version 1.67.0upstream/1.67.0
Diffstat (limited to 'boost/beast/core/impl/file_win32.ipp')
-rw-r--r-- | boost/beast/core/impl/file_win32.ipp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/boost/beast/core/impl/file_win32.ipp b/boost/beast/core/impl/file_win32.ipp index de4abae41f..c1b4cc6c7d 100644 --- a/boost/beast/core/impl/file_win32.ipp +++ b/boost/beast/core/impl/file_win32.ipp @@ -216,7 +216,7 @@ size(error_code& ec) const { if(h_ == boost::winapi::INVALID_HANDLE_VALUE_) { - ec.assign(errc::invalid_argument, generic_category()); + ec = make_error_code(errc::invalid_argument); return 0; } boost::winapi::LARGE_INTEGER_ fileSize; @@ -237,7 +237,7 @@ pos(error_code& ec) { if(h_ == boost::winapi::INVALID_HANDLE_VALUE_) { - ec.assign(errc::invalid_argument, generic_category()); + ec = make_error_code(errc::invalid_argument); return 0; } boost::winapi::LARGE_INTEGER_ in; @@ -261,7 +261,7 @@ seek(std::uint64_t offset, error_code& ec) { if(h_ == boost::winapi::INVALID_HANDLE_VALUE_) { - ec.assign(errc::invalid_argument, generic_category()); + ec = make_error_code(errc::invalid_argument); return; } boost::winapi::LARGE_INTEGER_ in; @@ -283,7 +283,7 @@ read(void* buffer, std::size_t n, error_code& ec) { if(h_ == boost::winapi::INVALID_HANDLE_VALUE_) { - ec.assign(errc::invalid_argument, generic_category()); + ec = make_error_code(errc::invalid_argument); return 0; } std::size_t nread = 0; @@ -300,9 +300,9 @@ read(void* buffer, std::size_t n, error_code& ec) boost::winapi::DWORD_ bytesRead; if(! ::ReadFile(h_, buffer, amount, &bytesRead, 0)) { - auto const dwError = ::GetLastError(); + auto const dwError = boost::winapi::GetLastError(); if(dwError != boost::winapi::ERROR_HANDLE_EOF_) - ec.assign(::GetLastError(), system_category()); + ec.assign(dwError, system_category()); else ec.assign(0, ec.category()); return nread; @@ -324,7 +324,7 @@ write(void const* buffer, std::size_t n, error_code& ec) { if(h_ == boost::winapi::INVALID_HANDLE_VALUE_) { - ec.assign(errc::invalid_argument, generic_category()); + ec = make_error_code(errc::invalid_argument); return 0; } std::size_t nwritten = 0; @@ -341,9 +341,9 @@ write(void const* buffer, std::size_t n, error_code& ec) boost::winapi::DWORD_ bytesWritten; if(! ::WriteFile(h_, buffer, amount, &bytesWritten, 0)) { - auto const dwError = ::GetLastError(); + auto const dwError = boost::winapi::GetLastError(); if(dwError != boost::winapi::ERROR_HANDLE_EOF_) - ec.assign(::GetLastError(), system_category()); + ec.assign(dwError, system_category()); else ec.assign(0, ec.category()); return nwritten; |