这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ class DockerConfigCredentialsProvider: CredentialsProvider {
inPipe.fileHandleForWriting.write("\(host)\n".data(using: .utf8)!)
inPipe.fileHandleForWriting.closeFile()

let outputData = try outPipe.fileHandleForReading.readToEnd()

process.waitUntilExit()

let outputData = try outPipe.fileHandleForReading.readToEnd()
if !(process.terminationReason == .exit && process.terminationStatus == 0) {
if let outputData = outputData {
print(String(decoding: outputData, as: UTF8.self))
Expand Down
9 changes: 5 additions & 4 deletions Sources/tart/MACAddressResolver/ARPCache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ struct ARPCache {
process.standardInput = FileHandle.nullDevice

try process.run()

guard let arpCommandOutput = try pipe.fileHandleForReading.readToEnd() else {
throw ARPCommandYieldedInvalidOutputError(explanation: "empty output")
}

process.waitUntilExit()

if !(process.terminationReason == .exit && process.terminationStatus == 0) {
Expand All @@ -60,10 +65,6 @@ struct ARPCache {
terminationStatus: process.terminationStatus)
}

guard let arpCommandOutput = try pipe.fileHandleForReading.readToEnd() else {
throw ARPCommandYieldedInvalidOutputError(explanation: "empty output")
}

self.arpCommandOutput = arpCommandOutput
}

Expand Down
Loading