0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-24 14:34:00 +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
{
struct error; // does not participate in ircd::exception hierarchy
extern const std::error_code eof;
}
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]
(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].ret = bytes;
@ -1089,8 +1089,8 @@ ircd::fs::_read_asio(const fd &fd,
}
};
assert(ret || ec == net::eof);
if(unlikely(ec && ec != net::eof))
assert(ret || ec == eof);
if(unlikely(ec && ec != eof))
throw_system_error(ec);
return ret;
@ -2873,6 +2873,12 @@ ircd::fs::bytes(const const_iovec_view &iov)
// fs/error.h
//
decltype(ircd::fs::eof)
ircd::fs::eof
{
make_error_code(boost::asio::error::eof)
};
std::string
ircd::string(const std::filesystem::filesystem_error &e)
{