1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

Fix struct timespec normalization (as used in many other places).

This commit is contained in:
Thomas Schwinge
2012-03-08 11:49:43 +01:00
parent 2edd9a79e5
commit 82d86f2844
4 changed files with 12 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2001, 2006 Free Software Foundation, Inc.
/* Copyright (C) 2001-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
@ -364,7 +364,7 @@ handle_requests (void *arg)
gettimeofday (&now, NULL);
wakeup_time.tv_sec = now.tv_sec + optim.gai_idle_time;
wakeup_time.tv_nsec = now.tv_usec * 1000;
if (wakeup_time.tv_nsec > 1000000000)
if (wakeup_time.tv_nsec >= 1000000000)
{
wakeup_time.tv_nsec -= 1000000000;
++wakeup_time.tv_sec;