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 {
698698 error.FastOpenAlreadyInProgress,
699699 error.MessageTooBig,
700700 error.FileDescriptorNotASocket,
701 error.AddressFamilyNotSupported,
701702 => return self.writeFileAllUnseekable(in_file, args),
702703
703704 else => |e| return e,
lib/std/os.zig+4-3
......@@ -2711,7 +2711,6 @@ pub const ShutdownError = error{
27112711
27122712 /// Connection was reset by peer, application should close socket as it is no longer usable.
27132713 ConnectionResetByPeer,
2714
27152714 BlockingOperationInProgress,
27162715
27172716 /// The network subsystem has failed.
......@@ -2719,8 +2718,7 @@ pub const ShutdownError = error{
27192718
27202719 /// The socket is not connected (connection-oriented sockets only).
27212720 SocketNotConnected,
2722
2723 SystemResources
2721 SystemResources,
27242722} || UnexpectedError;
27252723
27262724pub const ShutdownHow = enum { recv, send, both };
......@@ -4776,6 +4774,7 @@ pub const SendError = error{
47764774 BrokenPipe,
47774775
47784776 FileDescriptorNotASocket,
4777 AddressFamilyNotSupported,
47794778} || UnexpectedError;
47804779
47814780/// Transmit a message to another socket.
......@@ -4822,6 +4821,7 @@ pub fn sendto(
48224821 .WSAEMSGSIZE => return error.MessageTooBig,
48234822 .WSAENOBUFS => return error.SystemResources,
48244823 .WSAENOTSOCK => return error.FileDescriptorNotASocket,
4824 .WSAEAFNOSUPPORT => return error.AddressFamilyNotSupported,
48254825 // TODO: handle more errors
48264826 else => |err| return windows.unexpectedWSAError(err),
48274827 }
......@@ -4849,6 +4849,7 @@ pub fn sendto(
48494849 ENOTSOCK => unreachable, // The file descriptor sockfd does not refer to a socket.
48504850 EOPNOTSUPP => unreachable, // Some bit in the flags argument is inappropriate for the socket type.
48514851 EPIPE => return error.BrokenPipe,
4852 EAFNOSUPPORT => return error.AddressFamilyNotSupported,
48524853 else => |err| return unexpectedErrno(err),
48534854 }
48544855 }