From b28263a9104913ae3f3370a862de3e773bd41faa Mon Sep 17 00:00:00 2001 From: Michael Ilseman Date: Fri, 26 Feb 2021 12:59:21 -0700 Subject: [PATCH] Fixup some merge issues --- Sources/System/Internals/Mocking.swift | 6 +++--- Sources/System/Internals/Syscalls.swift | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/System/Internals/Mocking.swift b/Sources/System/Internals/Mocking.swift index 4a2a265..b1ca485 100644 --- a/Sources/System/Internals/Mocking.swift +++ b/Sources/System/Internals/Mocking.swift @@ -138,10 +138,10 @@ internal var forceWindowsPaths: Bool { #if ENABLE_MOCKING // Strip the mock_system prefix and the arg list suffix -private func originalSyscallName(_ s: String) -> String { +private func originalSyscallName(_ function: String) -> String { // `function` must be of format `system_()` - precondition(s.starts(with: "system_")) - return String(s.dropFirst("system_".count).prefix { $0.isLetter }) + precondition(function.starts(with: "system_")) + return String(function.dropFirst("system_".count).prefix { $0 != "(" }) } private func mockImpl( diff --git a/Sources/System/Internals/Syscalls.swift b/Sources/System/Internals/Syscalls.swift index e4897cc..a755928 100644 --- a/Sources/System/Internals/Syscalls.swift +++ b/Sources/System/Internals/Syscalls.swift @@ -102,14 +102,14 @@ internal func system_pwrite( return pwrite(fd, buf, nbyte, offset) } -public func system_dup(_ fd: Int32) -> Int32 { +internal func system_dup(_ fd: Int32) -> Int32 { #if ENABLE_MOCKING if mockingEnabled { return _mock(fd) } #endif return dup(fd) } -public func system_dup2(_ fd: Int32, _ fd2: Int32) -> Int32 { +internal func system_dup2(_ fd: Int32, _ fd2: Int32) -> Int32 { #if ENABLE_MOCKING if mockingEnabled { return _mock(fd, fd2) } #endif