Skip to content

Commit 9151860

Browse files
committed
Former-commit-id: 8efa0ac
2 parents a9ab035 + e5398e3 commit 9151860

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ urls += ["https://github.com/PerfectlySoft/Perfect-LinuxBridge.git"]
3030
let package = Package(
3131
name: "PerfectLib",
3232
targets: [],
33-
dependencies: urls.map { .Package(url: $0, majorVersion: 2, minor: 0) },
33+
dependencies: urls.map { .Package(url: $0, majorVersion: 2) },
3434
exclude: []
3535
)

Sources/PerfectLib/File.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ public class File {
137137
self.fd = Int(fd)
138138
}
139139

140+
deinit {
141+
close()
142+
}
143+
140144
/// Closes the file if it had been opened
141145
public func close() {
142146
if fd != -1 {

Sources/PerfectLib/SysProcess.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ public class SysProcess {
185185
guard status != -1 else {
186186
try ThrowSystemError()
187187
}
188+
if status == 0 && !hang {
189+
return 0
190+
}
188191
break
189192
}
190193
self.pid = -1

0 commit comments

Comments
 (0)