diff options
| author | Yoh Deadfall <yoh.deadfall@hotmail.com> | 2024-10-05 21:29:40 +0300 |
|---|---|---|
| committer | Yoh Deadfall <yoh.deadfall@hotmail.com> | 2024-10-05 21:29:40 +0300 |
| commit | 2223328d166a16cde864a17a5cb96de0853c9981 (patch) | |
| tree | d423e20c12b50aa056a94d1daa025f611aaf3652 /library/std/src | |
| parent | 8885239786c9efe5c6077de65536a5e092e34a55 (diff) | |
| download | rust-2223328d166a16cde864a17a5cb96de0853c9981.tar.gz rust-2223328d166a16cde864a17a5cb96de0853c9981.zip | |
Android: Debug assertion after setting thread name
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/sys/pal/unix/thread.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/library/std/src/sys/pal/unix/thread.rs b/library/std/src/sys/pal/unix/thread.rs index 2f2d6e6add3..04024661836 100644 --- a/library/std/src/sys/pal/unix/thread.rs +++ b/library/std/src/sys/pal/unix/thread.rs @@ -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); } } |
