Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kjessup committed Jan 17, 2017
2 parents d2c0a7a + e6ad388 commit 8efa0ac
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ urls += ["https://github.com/PerfectlySoft/Perfect-LinuxBridge.git"]
let package = Package(
name: "PerfectLib",
targets: [],
dependencies: urls.map { .Package(url: $0, majorVersion: 2, minor: 0) },
dependencies: urls.map { .Package(url: $0, majorVersion: 2) },
exclude: []
)
4 changes: 4 additions & 0 deletions Sources/PerfectLib/File.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ public class File {
self.fd = Int(fd)
}

deinit {
close()
}

/// Closes the file if it had been opened
public func close() {
if fd != -1 {
Expand Down
3 changes: 3 additions & 0 deletions Sources/PerfectLib/SysProcess.swift
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ public class SysProcess {
guard status != -1 else {
try ThrowSystemError()
}
if status == 0 && !hang {
return 0
}
break
}
self.pid = -1
Expand Down

0 comments on commit 8efa0ac

Please sign in to comment.