std.os.windows.WriteFile: Map ERROR_NO_DATA to error.BrokenPipe instead of ERROR_BROKEN_PIPE (#21811)
It appears that ReadFile returns ERROR_BROKEN_PIPE for a broken pipe, but WriteFile returns ERROR_NO_DATA. Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>
This commit is contained in:
@@ -682,7 +682,7 @@ pub fn WriteFile(
|
||||
.OPERATION_ABORTED => return error.OperationAborted,
|
||||
.NOT_ENOUGH_QUOTA => return error.SystemResources,
|
||||
.IO_PENDING => unreachable,
|
||||
.BROKEN_PIPE => return error.BrokenPipe,
|
||||
.NO_DATA => return error.BrokenPipe,
|
||||
.INVALID_HANDLE => return error.NotOpenForWriting,
|
||||
.LOCK_VIOLATION => return error.LockViolation,
|
||||
.NETNAME_DELETED => return error.ConnectionResetByPeer,
|
||||
|
||||
Reference in New Issue
Block a user