[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:
Bill Currie 2020-03-22 08:40:51 +09:00
parent 486728a4bd
commit 275ed22362

View file

@ -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;
}