Commit b07fee24 authored by Eric Dumazet's avatar Eric Dumazet Committed by Chris Wright

[PATCH] x86_64 : Fix vgettimeofday()

vgettimeofday() may return some bad timeval values, (tv_usec = 1000000), because of a wrong compare.
Signed-off-by: default avatarEric Dumazet <dada1@cosmosbay.com>
Signed-off-by: default avatarChris Wright <chrisw@sous-sol.org>
parent 9c1a8a9d
......@@ -132,7 +132,7 @@ static __always_inline void do_vgettimeofday(struct timeval * tv)
/* convert to usecs and add to timespec: */
tv->tv_usec += nsec_delta / NSEC_PER_USEC;
while (tv->tv_usec > USEC_PER_SEC) {
while (tv->tv_usec >= USEC_PER_SEC) {
tv->tv_sec += 1;
tv->tv_usec -= USEC_PER_SEC;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment