ts_sec -> tv_sec
ts_nsec -> tv_nsec
This commit is contained in:
parent
41b14ae59f
commit
934efd0502
@ -58,10 +58,10 @@ sleep(seconds)
|
||||
struct timespec time_remaining;
|
||||
|
||||
if (seconds) {
|
||||
time_to_sleep.ts_sec = seconds;
|
||||
time_to_sleep.ts_nsec = 0;
|
||||
time_to_sleep.tv_sec = seconds;
|
||||
time_to_sleep.tv_nsec = 0;
|
||||
nanosleep(&time_to_sleep,&time_remaining);
|
||||
seconds = time_remaining.ts_sec;
|
||||
seconds = time_remaining.tv_sec;
|
||||
}
|
||||
return(seconds);
|
||||
#else
|
||||
|
@ -60,8 +60,8 @@ usleep(useconds)
|
||||
struct timespec time_to_sleep;
|
||||
|
||||
if (useconds) {
|
||||
time_to_sleep.ts_nsec = (useconds % 1000000) * 1000;
|
||||
time_to_sleep.ts_sec = useconds / 1000000;
|
||||
time_to_sleep.tv_nsec = (useconds % 1000000) * 1000;
|
||||
time_to_sleep.tsvsec = useconds / 1000000;
|
||||
nanosleep(&time_to_sleep,NULL);
|
||||
}
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user