From 043bda4234d710434ab9ec0d54306fd6edb124e2 Mon Sep 17 00:00:00 2001 From: Kenta Kubo <601636+kkebo@users.noreply.github.com> Date: Wed, 4 Feb 2026 02:18:24 +0900 Subject: [PATCH] Remove unclear helper function --- Tests/SystemTests/StatTests.swift | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Tests/SystemTests/StatTests.swift b/Tests/SystemTests/StatTests.swift index a7d0637..fac1ae0 100644 --- a/Tests/SystemTests/StatTests.swift +++ b/Tests/SystemTests/StatTests.swift @@ -381,13 +381,15 @@ private struct StatTests { #endif flags.insert(userSettableFlags) - try #require(fchflags(fd.rawValue, flags.rawValue) == 0, "\(Errno.current)") + // On FreeBSD, the second argument of `fchflags` requires `UInt` instead of`UInt32`. + try #require(fchflags(fd.rawValue, .init(flags.rawValue)) == 0, "\(Errno.current)") stat = try fd.stat() #expect(stat.flags == flags) flags.remove(userSettableFlags) - try #require(fchflags(fd.rawValue, flags.rawValue) == 0, "\(Errno.current)") + // On FreeBSD, the second argument of `fchflags` requires `UInt` instead of`UInt32`. + try #require(fchflags(fd.rawValue, .init(flags.rawValue)) == 0, "\(Errno.current)") stat = try fd.stat() #expect(stat.flags == flags) @@ -414,11 +416,4 @@ private func == (lhs: timespec, rhs: timespec) -> Bool { lhs.tv_sec == rhs.tv_sec && lhs.tv_nsec == rhs.tv_nsec } -#if os(FreeBSD) -// Helper functions for FreeBSD -private func fchflags(_ fd: CInt, _ flags: CInterop.FileFlags) -> CInt { - fchflags(fd, UInt(flags)) -} -#endif - #endif