mirror of
https://github.com/ziglang/zig.git
synced 2024-11-15 16:45:27 +00:00
os/posix: handle ECONNRESET for write/writev
This commit is contained in:
parent
5a3ea9bece
commit
81adcd533e
@ -675,6 +675,9 @@ pub const WriteError = error{
|
||||
/// This error occurs when no global event loop is configured,
|
||||
/// and reading from the file descriptor would block.
|
||||
WouldBlock,
|
||||
|
||||
/// Connection reset by peer.
|
||||
ConnectionResetByPeer,
|
||||
} || UnexpectedError;
|
||||
|
||||
/// Write to a file descriptor.
|
||||
@ -752,6 +755,7 @@ pub fn write(fd: fd_t, bytes: []const u8) WriteError!usize {
|
||||
ENOSPC => return error.NoSpaceLeft,
|
||||
EPERM => return error.AccessDenied,
|
||||
EPIPE => return error.BrokenPipe,
|
||||
ECONNRESET => return error.ConnectionResetByPeer,
|
||||
else => |err| return unexpectedErrno(err),
|
||||
}
|
||||
}
|
||||
@ -820,6 +824,7 @@ pub fn writev(fd: fd_t, iov: []const iovec_const) WriteError!usize {
|
||||
ENOSPC => return error.NoSpaceLeft,
|
||||
EPERM => return error.AccessDenied,
|
||||
EPIPE => return error.BrokenPipe,
|
||||
ECONNRESET => return error.ConnectionResetByPeer,
|
||||
else => |err| return unexpectedErrno(err),
|
||||
}
|
||||
}
|
||||
|
@ -2859,6 +2859,7 @@ const FmtError = error{
|
||||
Unseekable,
|
||||
NotOpenForWriting,
|
||||
UnsupportedEncoding,
|
||||
ConnectionResetByPeer,
|
||||
} || fs.File.OpenError;
|
||||
|
||||
fn fmtPath(fmt: *Fmt, file_path: []const u8, check_mode: bool, dir: fs.Dir, sub_path: []const u8) FmtError!void {
|
||||
|
Loading…
Reference in New Issue
Block a user