diff --git a/src/header/bits_time/mod.rs b/src/header/bits_time/mod.rs index 801ed63d00..7c3e031ec9 100644 --- a/src/header/bits_time/mod.rs +++ b/src/header/bits_time/mod.rs @@ -5,7 +5,7 @@ use crate::{ /// See . #[repr(C)] -#[derive(Clone, Copy, Default, Debug)] +#[derive(Clone, Default, Debug)] pub struct timespec { pub tv_sec: time_t, pub tv_nsec: c_long, diff --git a/src/header/pthread/mutex.rs b/src/header/pthread/mutex.rs index 20d2b0f69a..9f53257dbf 100644 --- a/src/header/pthread/mutex.rs +++ b/src/header/pthread/mutex.rs @@ -76,7 +76,7 @@ pub unsafe extern "C" fn pthread_mutex_timedlock( mutex: *mut pthread_mutex_t, abstime: ×pec, ) -> c_int { - let relative = match timespec_realtime_to_monotonic(*abstime) { + let relative = match timespec_realtime_to_monotonic(abstime.clone()) { Ok(relative) => relative, Err(err) => return e(Err(err)), }; diff --git a/src/header/semaphore/mod.rs b/src/header/semaphore/mod.rs index 973b7dee74..70a8b8a7d6 100644 --- a/src/header/semaphore/mod.rs +++ b/src/header/semaphore/mod.rs @@ -96,7 +96,7 @@ pub unsafe extern "C" fn sem_clockwait( clock_id: clockid_t, abstime: *const timespec, ) -> c_int { - if let Ok(()) = unsafe { get(sem) }.wait(Some(&unsafe { *abstime }), clock_id) {}; // TODO handle error + if let Ok(()) = unsafe { get(sem) }.wait(Some(&unsafe { (*abstime).clone() }), clock_id) {}; // TODO handle error 0 } @@ -104,7 +104,8 @@ pub unsafe extern "C" fn sem_clockwait( /// See . #[unsafe(no_mangle)] pub unsafe extern "C" fn sem_timedwait(sem: *mut sem_t, abstime: *const timespec) -> c_int { - if let Ok(()) = unsafe { get(sem) }.wait(Some(&unsafe { *abstime }), CLOCK_REALTIME) {}; // TODO handle error + if let Ok(()) = unsafe { get(sem) }.wait(Some(&unsafe { (*abstime).clone() }), CLOCK_REALTIME) { + }; // TODO handle error 0 }