tackle some lints

This commit is contained in:
auronandace
2026-03-10 18:20:06 +00:00
parent 1bed273ad0
commit 8a2bfa2ed5
4 changed files with 13 additions and 9 deletions
+5 -1
View File
@@ -1160,9 +1160,13 @@ pub unsafe extern "C" fn unlink(path: *const c_char) -> c_int {
#[deprecated]
#[unsafe(no_mangle)]
pub extern "C" fn usleep(useconds: useconds_t) -> c_int {
#[cfg(not(target_arch = "x86"))]
let tv_nsec = c_long::from((useconds % 1_000_000) * 1000);
#[cfg(target_arch = "x86")]
let tv_nsec = ((useconds % 1_000_000) * 1000) as c_long;
let rqtp = timespec {
tv_sec: time_t::from(useconds / 1_000_000),
tv_nsec: ((useconds % 1_000_000) * 1000) as c_long,
tv_nsec,
};
let rmtp = ptr::null_mut();
unsafe { Sys::nanosleep(&raw const rqtp, rmtp) }