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:
@ -1,3 +1,10 @@
|
|||||||
|
2012-03-08 Thomas Schwinge <thomas@codesourcery.com>
|
||||||
|
|
||||||
|
* resolv/gai_misc.c (handle_requests): Fix struct timespec
|
||||||
|
normalization.
|
||||||
|
* rt/tst-cpuclock2.c (test_nanosleep): Likewise.
|
||||||
|
* sysdeps/pthread/aio_misc.c (handle_fildes_io): Likewise.
|
||||||
|
|
||||||
2012-03-08 Ulrich Drepper <drepper@gmail.com>
|
2012-03-08 Ulrich Drepper <drepper@gmail.com>
|
||||||
|
|
||||||
* stdio-common/tst-fphex.c: Various cleanups. The macros cannot
|
* stdio-common/tst-fphex.c: Various cleanups. The macros cannot
|
||||||
|
@ -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.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
|
Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
|
||||||
|
|
||||||
@ -364,7 +364,7 @@ handle_requests (void *arg)
|
|||||||
gettimeofday (&now, NULL);
|
gettimeofday (&now, NULL);
|
||||||
wakeup_time.tv_sec = now.tv_sec + optim.gai_idle_time;
|
wakeup_time.tv_sec = now.tv_sec + optim.gai_idle_time;
|
||||||
wakeup_time.tv_nsec = now.tv_usec * 1000;
|
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_nsec -= 1000000000;
|
||||||
++wakeup_time.tv_sec;
|
++wakeup_time.tv_sec;
|
||||||
|
@ -110,7 +110,7 @@ test_nanosleep (clockid_t clock, const char *which,
|
|||||||
struct timespec sleeptimeabs = sleeptime;
|
struct timespec sleeptimeabs = sleeptime;
|
||||||
sleeptimeabs.tv_sec += after.tv_sec;
|
sleeptimeabs.tv_sec += after.tv_sec;
|
||||||
sleeptimeabs.tv_nsec += after.tv_nsec;
|
sleeptimeabs.tv_nsec += after.tv_nsec;
|
||||||
while (sleeptimeabs.tv_nsec > 1000000000)
|
while (sleeptimeabs.tv_nsec >= 1000000000)
|
||||||
{
|
{
|
||||||
++sleeptimeabs.tv_sec;
|
++sleeptimeabs.tv_sec;
|
||||||
sleeptimeabs.tv_nsec -= 1000000000;
|
sleeptimeabs.tv_nsec -= 1000000000;
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
/* Handle general operations.
|
/* Handle general operations.
|
||||||
Copyright (C) 1997-2001, 2003, 2004, 2006, 2007, 2009, 2011
|
Copyright (C) 1997-2012 Free Software Foundation, Inc.
|
||||||
Free Software Foundation, Inc.
|
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||||
|
|
||||||
@ -635,7 +634,7 @@ handle_fildes_io (void *arg)
|
|||||||
gettimeofday (&now, NULL);
|
gettimeofday (&now, NULL);
|
||||||
wakeup_time.tv_sec = now.tv_sec + optim.aio_idle_time;
|
wakeup_time.tv_sec = now.tv_sec + optim.aio_idle_time;
|
||||||
wakeup_time.tv_nsec = now.tv_usec * 1000;
|
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_nsec -= 1000000000;
|
||||||
++wakeup_time.tv_sec;
|
++wakeup_time.tv_sec;
|
||||||
|
Reference in New Issue
Block a user