Skip to content

Commit

Permalink
Android: Debug assertion after setting thread name
Browse files Browse the repository at this point in the history
  • Loading branch information
YohDeadfall committed Oct 5, 2024
1 parent 8885239 commit 2223328
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion library/std/src/sys/pal/unix/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,15 @@ impl Thread {
pub fn set_name(name: &CStr) {
const PR_SET_NAME: libc::c_int = 15;
unsafe {
libc::prctl(
let res = libc::prctl(
PR_SET_NAME,
name.as_ptr(),
0 as libc::c_ulong,
0 as libc::c_ulong,
0 as libc::c_ulong,
);
// We have no good way of propagating errors here, but in debug-builds let's check that this actually worked.
debug_assert_eq!(res, 0);
}
}

Expand Down

0 comments on commit 2223328

Please sign in to comment.