Skip to content

Commit 64aa5e3

Browse files
committed
Always Handle Broken Pipes on Windows
Getting an ERROR_BROKEN_PIPE shouldn't be an error in any case, not just when we're reading untilEOF.
1 parent 7b72fbd commit 64aa5e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Foundation/FileHandle.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ open class FileHandle : NSObject {
267267
var BytesRead: DWORD = 0
268268
if !ReadFile(_handle, buffer.advanced(by: total), BytesToRead, &BytesRead, nil) {
269269
let err = GetLastError()
270-
if err == ERROR_BROKEN_PIPE && untilEOF {
270+
if err == ERROR_BROKEN_PIPE {
271271
break
272272
}
273273
free(buffer)

0 commit comments

Comments
 (0)