Skip to content

Commit 50c2e26

Browse files
committed
Remaining OpenBSD changes.
* OpenBSD also needs `pthread_mutex_t?`. * Originally I followed Darwin's check with `d_namlen`, but this should work too.
1 parent 26c5156 commit 50c2e26

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Sources/FoundationEssentials/FileManager/FileOperations+Enumeration.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,8 @@ struct _POSIXDirectoryContentsSequence: Sequence {
354354
continue
355355
}
356356
#endif
357-
#if os(FreeBSD)
357+
358+
#if os(FreeBSD) || os(OpenBSD)
358359
guard dent.pointee.d_fileno != 0 else {
359360
continue
360361
}
@@ -363,6 +364,7 @@ struct _POSIXDirectoryContentsSequence: Sequence {
363364
continue
364365
}
365366
#endif
367+
366368
// Use name
367369
let fileName: String
368370
#if os(WASI)

Sources/FoundationEssentials/LockedState.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ package struct LockedState<State> {
3131
private struct _Lock {
3232
#if canImport(os)
3333
typealias Primitive = os_unfair_lock
34-
#elseif os(FreeBSD)
34+
#elseif os(FreeBSD) || os(OpenBSD)
3535
typealias Primitive = pthread_mutex_t?
3636
#elseif canImport(Bionic) || canImport(Glibc) || canImport(Musl)
3737
typealias Primitive = pthread_mutex_t

0 commit comments

Comments
 (0)