std.posix.send: should expect ConnectionRefused

Closes: #20219
This commit is contained in:
Atlas Yu 2025-07-08 17:31:09 +08:00 committed by Alex Rønne Petersen
parent b60e9f2e85
commit 2cda4cfb39
2 changed files with 4 additions and 1 deletions

View File

@ -1109,6 +1109,7 @@ pub fn writeFileAll(self: File, in_file: File, args: WriteFileOptions) WriteFile
error.FileDescriptorNotASocket,
error.NetworkUnreachable,
error.NetworkSubsystemFailed,
error.ConnectionRefused,
=> return self.writeFileAllUnseekable(in_file, args),
else => |e| return e,
};

View File

@ -6088,6 +6088,9 @@ pub const SendError = error{
/// The local network interface used to reach the destination is down.
NetworkSubsystemFailed,
/// The destination address is not listening.
ConnectionRefused,
} || UnexpectedError;
pub const SendMsgError = SendError || error{
@ -6319,7 +6322,6 @@ pub fn send(
error.AddressNotAvailable => unreachable,
error.SocketNotConnected => unreachable,
error.UnreachableAddress => unreachable,
error.ConnectionRefused => unreachable,
else => |e| return e,
};
}