diff options
author | Eric Dumazet <dada1@cosmosbay.com> | 2007-05-15 10:17:58 +0200 |
---|---|---|
committer | Chris Wright <chrisw@sous-sol.org> | 2007-05-23 14:32:49 -0700 |
commit | b07fee24dcefbeed5bdacb7e1b74e8423a2c20be (patch) | |
tree | eb7fbce95a816b7d5eaa946e491525dfeed9d6f3 | |
parent | 9c1a8a9db20af892551c054268f66361732b7c06 (diff) |
[PATCH] x86_64 : Fix vgettimeofday()
vgettimeofday() may return some bad timeval values, (tv_usec = 1000000), because of a wrong compare.
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
-rw-r--r-- | arch/x86_64/kernel/vsyscall.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86_64/kernel/vsyscall.c b/arch/x86_64/kernel/vsyscall.c index b43c698cf7d3..fc9f0429e3ff 100644 --- a/arch/x86_64/kernel/vsyscall.c +++ b/arch/x86_64/kernel/vsyscall.c @@ -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; } |