swift-lang/fclose_issues.patch

20 lines
723 B
Diff

--- swift-tools-support-core/Sources/TSCBasic/FileSystem.swift.orig 2023-08-15 14:01:48.975819260 -0500
+++ swift-tools-support-core/Sources/TSCBasic/FileSystem.swift 2023-08-15 14:02:09.449066299 -0500
@@ -473,7 +473,7 @@
if fp == nil {
throw FileSystemError(errno: errno, path)
}
- defer { fclose(fp) }
+ defer { fclose(fp!) }
// Read the data one block at a time.
let data = BufferedOutputByteStream()
@@ -503,7 +503,7 @@
if fp == nil {
throw FileSystemError(errno: errno, path)
}
- defer { fclose(fp) }
+ defer { fclose(fp!) }
// Write the data in one chunk.
var contents = bytes.contents