Skip to content

Commit 10b1dd4

Browse files
John ButeJohn Bute
John Bute
authored and
John Bute
committed
added platform compatibility
1 parent 1963d73 commit 10b1dd4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sources/Basics/Concurrency/PID.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public protocol PIDFileHandler {
1919

2020
func readPID() -> Int32?
2121
func deletePIDFile() throws
22-
func writePID(pid: pid_t) throws
22+
func writePID(pid: Int32) throws
2323
func getCurrentPID() -> Int32
2424
}
2525

@@ -61,13 +61,13 @@ public struct PIDFile: PIDFileHandler {
6161
}
6262
}
6363

64-
/// Get the current PID of the process
64+
/// Get the current PID of the proces
6565
public func getCurrentPID() -> Int32 {
66-
getpid()
66+
return ProcessInfo.processInfo.processIdentifier
6767
}
6868

6969
/// Write .pid file containing PID of process currently using .build directory
70-
public func writePID(pid: pid_t) throws {
70+
public func writePID(pid: Int32) throws {
7171
let parent = self.lockFilePath.parentDirectory
7272
try FileManager.default.createDirectory(
7373
at: parent.asURL,

0 commit comments

Comments
 (0)