Skip to content

Commit 4df4ff0

Browse files
authored
Silence a warning on FreeBSD/OpenBSD when calling pthread_set_name_np(). (swiftlang#1241)
On FreeBSD and OpenBSD, `pthread_set_name_np()` returns `void`, so we don't need to suppress the result (assigning it to `_`) and the Swift compiler complains that we do. ### Checklist: - [x] Code and documentation should follow the style of the [Style Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md). - [x] If public symbols are renamed or modified, DocC references should be updated.
1 parent fdf2754 commit 4df4ff0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/Testing/ExitTests/WaitFor.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ private let _createWaitThread: Void = {
167167
_ = _pthread_setname_np?(pthread_self(), "SWT ExT monitor")
168168
#endif
169169
#elseif os(FreeBSD)
170-
_ = pthread_set_name_np(pthread_self(), "SWT ex test monitor")
170+
pthread_set_name_np(pthread_self(), "SWT ex test monitor")
171171
#elseif os(OpenBSD)
172-
_ = pthread_set_name_np(pthread_self(), "SWT exit test monitor")
172+
pthread_set_name_np(pthread_self(), "SWT exit test monitor")
173173
#else
174174
#warning("Platform-specific implementation missing: thread naming unavailable")
175175
#endif

0 commit comments

Comments
 (0)