Skip to content

Commit 29b8593

Browse files
committed
std::thread::set_name exploit the return on haiku
1 parent bb90f81 commit 29b8593

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

library/std/src/sys/unix/thread.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,9 @@ impl Thread {
204204
pub fn set_name(name: &CStr) {
205205
unsafe {
206206
let thread_self = libc::find_thread(ptr::null_mut());
207-
libc::rename_thread(thread_self, name.as_ptr());
207+
let res = libc::rename_thread(thread_self, name.as_ptr());
208+
// We have no good way of propagating errors here, but in debug-builds let's check that this actually worked.
209+
debug_assert_eq!(res, libc::B_OK);
208210
}
209211
}
210212

0 commit comments

Comments
 (0)