From 9c3b72d554e29cab41576b01f5d5cd23d62b1e1c Mon Sep 17 00:00:00 2001 From: Si Beaumont Date: Thu, 9 Jun 2022 19:37:34 +0100 Subject: [PATCH] fixup: Remove os(Windows) guards for resize internals Signed-off-by: Si Beaumont --- Sources/System/Internals/Syscalls.swift | 2 -- Tests/SystemTests/FileOperationsTest.swift | 2 -- 2 files changed, 4 deletions(-) diff --git a/Sources/System/Internals/Syscalls.swift b/Sources/System/Internals/Syscalls.swift index b22d6a3f..b90f4eb9 100644 --- a/Sources/System/Internals/Syscalls.swift +++ b/Sources/System/Internals/Syscalls.swift @@ -125,11 +125,9 @@ internal func system_pipe(_ fds: UnsafeMutablePointer) -> CInt { } #endif -#if !os(Windows) internal func system_ftruncate(_ fd: Int32, _ length: off_t) -> Int32 { #if ENABLE_MOCKING if mockingEnabled { return _mock(fd, length) } #endif return ftruncate(fd, length) } -#endif diff --git a/Tests/SystemTests/FileOperationsTest.swift b/Tests/SystemTests/FileOperationsTest.swift index 419e1c97..3868347a 100644 --- a/Tests/SystemTests/FileOperationsTest.swift +++ b/Tests/SystemTests/FileOperationsTest.swift @@ -161,7 +161,6 @@ final class FileOperationsTest: XCTestCase { } -#if !os(Windows) func testResizeFile() throws { let fd = try FileDescriptor.open("/tmp/\(UUID().uuidString).txt", .readWrite, options: [.create, .truncate], permissions: .ownerReadWrite) try fd.closeAfter { @@ -203,6 +202,5 @@ final class FileOperationsTest: XCTestCase { XCTAssertEqual(readBytesAfterTruncation, Array("ab".utf8)) } } -#endif }