Use generic_cateogry for errno

This commit is contained in:
Vinnie Falco
2017-07-20 08:15:27 -07:00
parent cdff15e021
commit a26017d695
4 changed files with 20 additions and 8 deletions
+10 -8
View File
@@ -180,8 +180,8 @@ init(beast::error_code& ec)
if(! file_)
{
// Convert the old-school `errno` into
// an error code using the system category.
ec = beast::error_code{errno, beast::system_category()};
// an error code using the generic category.
ec = beast::error_code{errno, beast::generic_category()};
return;
}
@@ -219,8 +219,9 @@ get(beast::error_code& ec) ->
// Handle any errors
if(ferror(file_))
{
// Convert old-school `errno` to error_code
ec = beast::error_code(errno, beast::system_category());
// Convert the old-school `errno` into
// an error code using the generic category.
ec = beast::error_code{errno, beast::generic_category()};
return boost::none;
}
@@ -350,8 +351,8 @@ init(boost::optional<std::uint64_t> const& content_length, beast::error_code& ec
if(! file_)
{
// Convert the old-school `errno` into
// an error code using the system category.
ec = beast::error_code{errno, beast::system_category()};
// an error code using the generic category.
ec = beast::error_code{errno, beast::generic_category()};
return;
}
@@ -379,8 +380,9 @@ put(ConstBufferSequence const& buffers, beast::error_code& ec)
// Handle any errors
if(ferror(file_))
{
// Convert old-school `errno` to error_code
ec = beast::error_code(errno, beast::system_category());
// Convert the old-school `errno` into
// an error code using the generic category.
ec = beast::error_code{errno, beast::generic_category()};
return;
}
}