bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sleep from coreutils-5.0 doesn't work on AIX 4.3.3


From: Jim Meyering
Subject: Re: sleep from coreutils-5.0 doesn't work on AIX 4.3.3
Date: Thu, 08 May 2003 18:30:31 +0200

Paul Eggert <address@hidden> wrote:
> I looked at that code a bit more and noticed that timespec_subtract
> can misbehave in unusual situations where x->tv_sec - y->tv_sec
> overflows.  Also, it seems to worry about nsec being out of range, but
> that's not possible here and it makes it harder to follow the code
> (and I'm not sure the extra complexity is correct anyway).  And the
> xnanosleep code doesn't check for clock_get_realtime failing the
> second time it's called.  Also, now that the code is cleaned up
> there's little point to having a clock_get_realtime function at all.
> So how about the following further patch?

I like it!
Thank you.

> 2003-05-07  Paul Eggert  <address@hidden>
>
>       * lib/xnanosleep.c (timespec_subtract): Don't modify the 2nd arg.
>         Work even if X-Y overflows when subtracting.  Make explicit the
>         assumption that tv_nsec must be in range.
>         (clock_get_realtime): Remove.  All callers changed to invoke gettime,
>         for simplicity.
>         (xnanosleep): Check for gettime failure every time.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]