authorgravatar for git@l4.pmLuna <git@l4.pm> 2020-12-05 23:46:08-03:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-12-07 16:40:03-05:00
log5f7b97e84c7e2bc7682510e97996ad30147026d0
treebe01c06e770f020dcf612b69806ef42a843cb7ed
parent5c60558796715c109ddbe12472fe5692029736b2

add AddressFamilyNotSupported to SendError


2 files changed, 5 insertions(+), 3 deletions(-)

lib/std/fs/file.zig+1
...@@ -698,6 +698,7 @@ pub const File = struct {...@@ -698,6 +698,7 @@ pub const File = struct {
698 error.FastOpenAlreadyInProgress,698 error.FastOpenAlreadyInProgress,
699 error.MessageTooBig,699 error.MessageTooBig,
700 error.FileDescriptorNotASocket,700 error.FileDescriptorNotASocket,
701 error.AddressFamilyNotSupported,
701 => return self.writeFileAllUnseekable(in_file, args),702 => return self.writeFileAllUnseekable(in_file, args),
702703
703 else => |e| return e,704 else => |e| return e,
lib/std/os.zig+4-3
...@@ -2711,7 +2711,6 @@ pub const ShutdownError = error{...@@ -2711,7 +2711,6 @@ pub const ShutdownError = error{
27112711
2712 /// Connection was reset by peer, application should close socket as it is no longer usable.2712 /// Connection was reset by peer, application should close socket as it is no longer usable.
2713 ConnectionResetByPeer,2713 ConnectionResetByPeer,
2714
2715 BlockingOperationInProgress,2714 BlockingOperationInProgress,
27162715
2717 /// The network subsystem has failed.2716 /// The network subsystem has failed.
...@@ -2719,8 +2718,7 @@ pub const ShutdownError = error{...@@ -2719,8 +2718,7 @@ pub const ShutdownError = error{
27192718
2720 /// The socket is not connected (connection-oriented sockets only).2719 /// The socket is not connected (connection-oriented sockets only).
2721 SocketNotConnected,2720 SocketNotConnected,
27222721 SystemResources,
2723 SystemResources
2724} || UnexpectedError;2722} || UnexpectedError;
27252723
2726pub const ShutdownHow = enum { recv, send, both };2724pub const ShutdownHow = enum { recv, send, both };
...@@ -4776,6 +4774,7 @@ pub const SendError = error{...@@ -4776,6 +4774,7 @@ pub const SendError = error{
4776 BrokenPipe,4774 BrokenPipe,
47774775
4778 FileDescriptorNotASocket,4776 FileDescriptorNotASocket,
4777 AddressFamilyNotSupported,
4779} || UnexpectedError;4778} || UnexpectedError;
47804779
4781/// Transmit a message to another socket.4780/// Transmit a message to another socket.
...@@ -4822,6 +4821,7 @@ pub fn sendto(...@@ -4822,6 +4821,7 @@ pub fn sendto(
4822 .WSAEMSGSIZE => return error.MessageTooBig,4821 .WSAEMSGSIZE => return error.MessageTooBig,
4823 .WSAENOBUFS => return error.SystemResources,4822 .WSAENOBUFS => return error.SystemResources,
4824 .WSAENOTSOCK => return error.FileDescriptorNotASocket,4823 .WSAENOTSOCK => return error.FileDescriptorNotASocket,
4824 .WSAEAFNOSUPPORT => return error.AddressFamilyNotSupported,
4825 // TODO: handle more errors4825 // TODO: handle more errors
4826 else => |err| return windows.unexpectedWSAError(err),4826 else => |err| return windows.unexpectedWSAError(err),
4827 }4827 }
...@@ -4849,6 +4849,7 @@ pub fn sendto(...@@ -4849,6 +4849,7 @@ pub fn sendto(
4849 ENOTSOCK => unreachable, // The file descriptor sockfd does not refer to a socket.4849 ENOTSOCK => unreachable, // The file descriptor sockfd does not refer to a socket.
4850 EOPNOTSUPP => unreachable, // Some bit in the flags argument is inappropriate for the socket type.4850 EOPNOTSUPP => unreachable, // Some bit in the flags argument is inappropriate for the socket type.
4851 EPIPE => return error.BrokenPipe,4851 EPIPE => return error.BrokenPipe,
4852 EAFNOSUPPORT => return error.AddressFamilyNotSupported,
4852 else => |err| return unexpectedErrno(err),4853 else => |err| return unexpectedErrno(err),
4853 }4854 }
4854 }4855 }