mirror of
https://github.com/matrix-construct/construct
synced 2024-05-20 03:43:47 +02:00
ircd::fs: Assertions for file read length sanity.
This commit is contained in:
parent
3c3fb030bc
commit
fc0b6bbecb
|
@ -3421,6 +3421,7 @@ const noexcept try
|
|||
fs::read(fd, buf, opts)
|
||||
};
|
||||
|
||||
assert(!opts.all || size(read) == length);
|
||||
*result = slice(read);
|
||||
return Status::OK();
|
||||
}
|
||||
|
@ -3862,6 +3863,7 @@ const noexcept try
|
|||
fs::read(fd, buf, opts)
|
||||
};
|
||||
|
||||
assert(!opts.all || size(read) == length);
|
||||
*result = slice(read);
|
||||
return Status::OK();
|
||||
}
|
||||
|
|
|
@ -1089,6 +1089,7 @@ ircd::fs::_read_asio(const fd &fd,
|
|||
}
|
||||
};
|
||||
|
||||
assert(ret <= bytes(iov));
|
||||
assert(ret || ec == eof);
|
||||
if(unlikely(ec && ec != eof))
|
||||
throw_system_error(ec);
|
||||
|
|
Loading…
Reference in a new issue