mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
fix aliasing issue in unix sleep function
This commit is contained in:
parent
ed96321e7e
commit
9f630af930
@ -178,7 +178,8 @@ impl Thread {
|
||||
tv_nsec: nsecs,
|
||||
};
|
||||
secs -= ts.tv_sec as u64;
|
||||
if libc::nanosleep(&ts, &mut ts) == -1 {
|
||||
let ts_ptr = &mut ts as *mut _;
|
||||
if libc::nanosleep(ts_ptr, ts_ptr) == -1 {
|
||||
assert_eq!(os::errno(), libc::EINTR);
|
||||
secs += ts.tv_sec as u64;
|
||||
nsecs = ts.tv_nsec;
|
||||
|
Loading…
Reference in New Issue
Block a user