[*] Undo fail on pipe broken, restore bytes written = zero behavior for reusable pipes. Will match on Linux.

This commit is contained in:
Reece Wilson 2022-07-05 04:17:28 +01:00
parent c0ee48435c
commit 97069a1515
2 changed files with 14 additions and 2 deletions

View File

@ -317,6 +317,12 @@ namespace Aurora::IO::FS
return {};
}
if (this->memoryHold_)
{
SysPushErrorIO("IO Operation in progress");
return {};
}
this->latch_ = false;
::ResetEvent(this->event_);
@ -353,6 +359,12 @@ namespace Aurora::IO::FS
return {};
}
if (this->memoryHold_)
{
SysPushErrorIO("IO Operation in progress");
return {};
}
this->latch_ = false;
::ResetEvent(this->event_);
@ -409,7 +421,7 @@ namespace Aurora::IO::FS
bool NtAsyncFileTransaction::Failed()
{
return this->hasFailed;
return this->hasFailed && this->osErrorCode != ERROR_BROKEN_PIPE;
}
AuUInt NtAsyncFileTransaction::GetOSErrorCode()

View File

@ -88,8 +88,8 @@ namespace Aurora::IO::FS
AuWPtr<Aurora::IO::IPC::IPCPipeImpl> ntIpcPipeImpl;
private:
AuSPtr<void> memoryHold_;
private:
AuSPtr<FileHandle> handle_;
AuSPtr<IAsyncFinishedSubscriber> sub_;
};