Skip to content

Commit e3dd7f2

Browse files
committed
clean file descriptor on detach
1 parent 1a970dd commit e3dd7f2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/Venice/FileDescriptor.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ public final class FileDescriptor {
141141
/// After `detach` any operation will throw an error.
142142
///
143143
/// - Returns: The underlying file descriptor.
144-
public func detach() -> Int32 {
144+
@discardableResult public func detach() -> Int32 {
145+
clean()
146+
145147
defer {
146148
fileDescriptor = -1
147149
}

0 commit comments

Comments
 (0)