aboutsummaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorJulian Noble <julian@precisium.com.au>2024-10-30 01:10:19 +1100
committerGitHub <noreply@github.com>2024-10-29 15:10:19 +0100
commita03ab9ee01129913af526a38b688313ccd83dca2 (patch)
tree385470c1387945fa8a31686c300dd15a18427235 /lib/std
parentb5cafe223a5ed90fe1a10f6d0c1e492f81f4b586 (diff)
downloadzig-a03ab9ee01129913af526a38b688313ccd83dca2.tar.gz
zig-a03ab9ee01129913af526a38b688313ccd83dca2.zip
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>
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/os/windows.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/std/os/windows.zig b/lib/std/os/windows.zig
index 7a460d5a9e..dbd6df46b7 100644
--- a/lib/std/os/windows.zig
+++ b/lib/std/os/windows.zig
@@ -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,