0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-25 23:14:13 +01:00

ircd::fs: Replace reuses of net::eof w/ specific fs::eof.

This commit is contained in:
Jason Volk 2023-01-26 14:11:58 -08:00
parent 12756d3737
commit dfb4e19848
2 changed files with 11 additions and 3 deletions

View file

@ -14,6 +14,8 @@
namespace ircd::fs namespace ircd::fs
{ {
struct error; // does not participate in ircd::exception hierarchy struct error; // does not participate in ircd::exception hierarchy
extern const std::error_code eof;
} }
namespace ircd namespace ircd

View file

@ -948,7 +948,7 @@ ircd::fs::_read_asio(const vector_view<read_op> &op)
d[i]->async_read_some_at(op[i].opts->offset, op[i].bufs, [i, &op, &ret, &latch] d[i]->async_read_some_at(op[i].opts->offset, op[i].bufs, [i, &op, &ret, &latch]
(const auto &ec, const size_t &bytes) (const auto &ec, const size_t &bytes)
{ {
if(ec && ec != net::eof) if(ec && ec != eof)
op[i].eptr = make_system_eptr(ec); op[i].eptr = make_system_eptr(ec);
op[i].ret = bytes; op[i].ret = bytes;
@ -1089,8 +1089,8 @@ ircd::fs::_read_asio(const fd &fd,
} }
}; };
assert(ret || ec == net::eof); assert(ret || ec == eof);
if(unlikely(ec && ec != net::eof)) if(unlikely(ec && ec != eof))
throw_system_error(ec); throw_system_error(ec);
return ret; return ret;
@ -2873,6 +2873,12 @@ ircd::fs::bytes(const const_iovec_view &iov)
// fs/error.h // fs/error.h
// //
decltype(ircd::fs::eof)
ircd::fs::eof
{
make_error_code(boost::asio::error::eof)
};
std::string std::string
ircd::string(const std::filesystem::filesystem_error &e) ircd::string(const std::filesystem::filesystem_error &e)
{ {