Merge pull request #19120 from jacobly0/os-cleanup

posix: fix socket fd leak
This commit is contained in:
Andrew Kelley 2024-02-28 05:51:15 -08:00 committed by GitHub
commit a1b083b666
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 163 additions and 212 deletions

View file

@ -392,7 +392,10 @@ pub const Os = struct {
/// Checks if system is guaranteed to be at least `version` or older than `version`. /// Checks if system is guaranteed to be at least `version` or older than `version`.
/// Returns `null` if a runtime check is required. /// Returns `null` if a runtime check is required.
pub inline fn isAtLeast(self: Os, comptime tag: Tag, version: anytype) ?bool { pub inline fn isAtLeast(self: Os, comptime tag: Tag, version: switch (tag) {
else => std.SemanticVersion,
.windows => WindowsVersion,
}) ?bool {
if (self.tag != tag) return false; if (self.tag != tag) return false;
return switch (tag) { return switch (tag) {

File diff suppressed because it is too large Load diff