Fix file pointer management in FileStream. Fixes rejectedsoftware/vibe.d#1684.
This commit is contained in:
parent
d07e9258d9
commit
68430a1ea4
2 changed files with 9 additions and 1 deletions
|
@ -459,11 +459,12 @@ struct FileStream {
|
|||
}
|
||||
|
||||
size_t read(ubyte[] dst, IOMode mode)
|
||||
{
|
||||
{
|
||||
auto res = asyncAwait!(FileIOCallback,
|
||||
cb => eventDriver.files.read(m_fd, ctx.ptr, dst, mode, cb),
|
||||
cb => eventDriver.files.cancelRead(m_fd)
|
||||
);
|
||||
ctx.ptr += res[2];
|
||||
enforce(res[1] == IOStatus.ok, "Failed to read data from disk.");
|
||||
return res[2];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue