Skip to content

Commit b28263a

Browse files
committed
Fixup some merge issues
1 parent bae68a5 commit b28263a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Sources/System/Internals/Mocking.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ internal var forceWindowsPaths: Bool {
138138

139139
#if ENABLE_MOCKING
140140
// Strip the mock_system prefix and the arg list suffix
141-
private func originalSyscallName(_ s: String) -> String {
141+
private func originalSyscallName(_ function: String) -> String {
142142
// `function` must be of format `system_<name>(<parameters>)`
143-
precondition(s.starts(with: "system_"))
144-
return String(s.dropFirst("system_".count).prefix { $0.isLetter })
143+
precondition(function.starts(with: "system_"))
144+
return String(function.dropFirst("system_".count).prefix { $0 != "(" })
145145
}
146146

147147
private func mockImpl(

Sources/System/Internals/Syscalls.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,14 @@ internal func system_pwrite(
102102
return pwrite(fd, buf, nbyte, offset)
103103
}
104104

105-
public func system_dup(_ fd: Int32) -> Int32 {
105+
internal func system_dup(_ fd: Int32) -> Int32 {
106106
#if ENABLE_MOCKING
107107
if mockingEnabled { return _mock(fd) }
108108
#endif
109109
return dup(fd)
110110
}
111111

112-
public func system_dup2(_ fd: Int32, _ fd2: Int32) -> Int32 {
112+
internal func system_dup2(_ fd: Int32, _ fd2: Int32) -> Int32 {
113113
#if ENABLE_MOCKING
114114
if mockingEnabled { return _mock(fd, fd2) }
115115
#endif

0 commit comments

Comments
 (0)