Skip to content

Commit d8c8d52

Browse files
pseudoccalexrp
authored andcommitted
std.posix.send: should expect ConnectionRefused
Closes: #20219
1 parent 5360968 commit d8c8d52

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/std/fs/File.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,7 @@ pub fn writeFileAll(self: File, in_file: File, args: WriteFileOptions) WriteFile
11091109
error.FileDescriptorNotASocket,
11101110
error.NetworkUnreachable,
11111111
error.NetworkSubsystemFailed,
1112+
error.ConnectionRefused,
11121113
=> return self.writeFileAllUnseekable(in_file, args),
11131114
else => |e| return e,
11141115
};

lib/std/posix.zig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6088,6 +6088,9 @@ pub const SendError = error{
60886088

60896089
/// The local network interface used to reach the destination is down.
60906090
NetworkSubsystemFailed,
6091+
6092+
/// The destination address is not listening.
6093+
ConnectionRefused,
60916094
} || UnexpectedError;
60926095

60936096
pub const SendMsgError = SendError || error{
@@ -6319,7 +6322,6 @@ pub fn send(
63196322
error.AddressNotAvailable => unreachable,
63206323
error.SocketNotConnected => unreachable,
63216324
error.UnreachableAddress => unreachable,
6322-
error.ConnectionRefused => unreachable,
63236325
else => |e| return e,
63246326
};
63256327
}

0 commit comments

Comments
 (0)