File tree 1 file changed +4
-4
lines changed
Sources/Basics/Concurrency
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ public protocol PIDFileHandler {
19
19
20
20
func readPID( ) -> Int32 ?
21
21
func deletePIDFile( ) throws
22
- func writePID( pid: pid_t ) throws
22
+ func writePID( pid: Int32 ) throws
23
23
func getCurrentPID( ) -> Int32
24
24
}
25
25
@@ -61,13 +61,13 @@ public struct PIDFile: PIDFileHandler {
61
61
}
62
62
}
63
63
64
- /// Get the current PID of the process
64
+ /// Get the current PID of the proces
65
65
public func getCurrentPID( ) -> Int32 {
66
- getpid ( )
66
+ return ProcessInfo . processInfo . processIdentifier
67
67
}
68
68
69
69
/// 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 {
71
71
let parent = self . lockFilePath. parentDirectory
72
72
try FileManager . default. createDirectory (
73
73
at: parent. asURL,
You can’t perform that action at this time.
0 commit comments