mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-08 13:02:50 +00:00
Auto merge of #115356 - devnexen:haiku_set_name_use_return, r=thomcc
`std:🧵:set_name` exploit the return on haiku
This commit is contained in:
commit
815b3ae00a
@ -207,7 +207,9 @@ impl Thread {
|
||||
pub fn set_name(name: &CStr) {
|
||||
unsafe {
|
||||
let thread_self = libc::find_thread(ptr::null_mut());
|
||||
libc::rename_thread(thread_self, name.as_ptr());
|
||||
let res = libc::rename_thread(thread_self, name.as_ptr());
|
||||
// We have no good way of propagating errors here, but in debug-builds let's check that this actually worked.
|
||||
debug_assert_eq!(res, libc::B_OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user