Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Former-commit-id: 8efa0ac
  • Loading branch information
kjessup committed Jan 17, 2017
2 parents a9ab035 + e5398e3 commit 9151860
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 9151860

Please sign in to comment.