mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
[qwaq] Actually ensure tv_nsec is valid
While typing the previous message I thought to check my "carry" logic. Sure enough, it was wrong... out by 1. I guess I won the threading lottery :P
This commit is contained in:
parent
486728a4bd
commit
275ed22362
1 changed files with 1 additions and 1 deletions
|
@ -582,7 +582,7 @@ qwaq_init_timeout (struct timespec *timeout, long time)
|
|||
gettimeofday(&now, 0);
|
||||
timeout->tv_sec = now.tv_sec;
|
||||
timeout->tv_nsec = now.tv_usec * 1000L + time;
|
||||
if (timeout->tv_nsec > SEC) {
|
||||
if (timeout->tv_nsec >= SEC) {
|
||||
timeout->tv_sec += timeout->tv_nsec / SEC;
|
||||
timeout->tv_nsec %= SEC;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue