authorgravatar for julian@precisium.com.auJulian Noble <julian@precisium.com.au> 2024-10-30 01:10:19+11:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2024-10-29 15:10:19+01:00
loga03ab9ee01129913af526a38b688313ccd83dca2
tree385470c1387945fa8a31686c300dd15a18427235
parentb5cafe223a5ed90fe1a10f6d0c1e492f81f4b586
signaturebadge-check Signed by PGP key B5690EEEBB952194

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>

1 files changed, 1 insertions(+), 1 deletions(-)

lib/std/os/windows.zig+1-1
...@@ -682,7 +682,7 @@ pub fn WriteFile(...@@ -682,7 +682,7 @@ pub fn WriteFile(
682 .OPERATION_ABORTED => return error.OperationAborted,682 .OPERATION_ABORTED => return error.OperationAborted,
683 .NOT_ENOUGH_QUOTA => return error.SystemResources,683 .NOT_ENOUGH_QUOTA => return error.SystemResources,
684 .IO_PENDING => unreachable,684 .IO_PENDING => unreachable,
685 .BROKEN_PIPE => return error.BrokenPipe,685 .NO_DATA => return error.BrokenPipe,
686 .INVALID_HANDLE => return error.NotOpenForWriting,686 .INVALID_HANDLE => return error.NotOpenForWriting,
687 .LOCK_VIOLATION => return error.LockViolation,687 .LOCK_VIOLATION => return error.LockViolation,
688 .NETNAME_DELETED => return error.ConnectionResetByPeer,688 .NETNAME_DELETED => return error.ConnectionResetByPeer,