mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-27 05:04:27 +00:00
Read stdout to end before waiting for task to end to prevent deadlock
This commit is contained in:
1 parent
115686cd07
commit
f700c96e47
1 file changed
+3
-2
Vendored
+3
-2
@@ -104,9 +104,10 @@
|
||||
[inputPipe.fileHandleForWriting writeData:promptData];
|
||||
[inputPipe.fileHandleForWriting closeFile];
|
||||
|
||||
[task waitUntilExit];
|
||||
|
||||
// Read data to end *before* waiting until the task ends so we don't deadlock if the stdout buffer becomes full if we haven't consumed from it
|
||||
output = [outputPipe.fileHandleForReading readDataToEndOfFile];
|
||||
|
||||
[task waitUntilExit];
|
||||
taskResult = task.terminationStatus;
|
||||
}
|
||||
@catch (NSException *)
|
||||
|
||||
Reference in new issue
Block a user