fix: enable battery top process reader (pipe was closed when setup)

This commit is contained in:
Serhiy Mytrovtsiy
2021-03-29 17:23:56 +02:00
parent d279c74adb
commit b802bd6b40

View File

@@ -159,10 +159,6 @@ public class ProcessReader: Reader<[TopProcess]> {
let pipe = Pipe()
defer {
pipe.fileHandleForReading.closeFile()
}
self.task.standardOutput = pipe
self.task.launchPath = "/usr/bin/top"
self.task.arguments = ["-o", "power", "-n", "\(self.numberOfProcesses)", "-stats", "pid,command,power"]