authorgravatar for steve@raffmail.netzigster64 <steve@raffmail.net> 2022-11-22 13:54:33+10:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-01-28 18:27:43-05:00
log2b27bc2c65195a82e96995669314a86c76203a3e
tree0a1a961e83d87c71ca9e9fbfbb206640c73ef5ee
parent5a67ae506a381aa0494b4b066a8c54ba7ed9fc31

On BrokenPipe error during os.sendfile - return error rather than unreachable


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

lib/std/os.zig+4-4
......@@ -6028,7 +6028,7 @@ pub fn sendfile(
60286028 .BADF => unreachable, // Always a race condition.
60296029 .FAULT => unreachable, // Segmentation fault.
60306030 .OVERFLOW => unreachable, // We avoid passing too large of a `count`.
6031 .NOTCONN => unreachable, // `out_fd` is an unconnected socket.
6031 .NOTCONN => return error.BrokenPipe, // `out_fd` is an unconnected socket
60326032
60336033 .INVAL, .NOSYS => {
60346034 // EINVAL could be any of the following situations:
......@@ -6096,7 +6096,7 @@ pub fn sendfile(
60966096
60976097 .BADF => unreachable, // Always a race condition.
60986098 .FAULT => unreachable, // Segmentation fault.
6099 .NOTCONN => unreachable, // `out_fd` is an unconnected socket.
6099 .NOTCONN => return error.BrokenPipe, // `out_fd` is an unconnected socket
61006100
61016101 .INVAL, .OPNOTSUPP, .NOTSOCK, .NOSYS => {
61026102 // EINVAL could be any of the following situations:
......@@ -6178,7 +6178,7 @@ pub fn sendfile(
61786178 .BADF => unreachable, // Always a race condition.
61796179 .FAULT => unreachable, // Segmentation fault.
61806180 .INVAL => unreachable,
6181 .NOTCONN => unreachable, // `out_fd` is an unconnected socket.
6181 .NOTCONN => return error.BrokenPipe, // `out_fd` is an unconnected socket
61826182
61836183 .OPNOTSUPP, .NOTSOCK, .NOSYS => break :sf,
61846184
......@@ -6472,7 +6472,7 @@ pub fn recvfrom(
64726472 .BADF => unreachable, // always a race condition
64736473 .FAULT => unreachable,
64746474 .INVAL => unreachable,
6475 .NOTCONN => unreachable,
6475 .NOTCONN => return error.SocketNotConnected,
64766476 .NOTSOCK => unreachable,
64776477 .INTR => continue,
64786478 .AGAIN => return error.WouldBlock,