This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: [patch,1.7.10] clock_setres returns zero
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin-patches at cygwin dot com
- Date: Tue, 13 Dec 2011 12:40:05 +0100
- Subject: Re: [patch,1.7.10] clock_setres returns zero
- References: <4EE686D5.3080905@gmail.com>
- Reply-to: cygwin-patches at cygwin dot com
On Dec 12 22:57, Dave Korn wrote:
> This happens because on my PC, QueryPerformanceFrequency returns 2511600000,
> so the following code in times.cc#hires_ns::prime()
Wow. I can reproduce this on my 2K3R2 64 bit system on which
QueryPerformanceFrequency returns 2601000000.
> * times.cc (hires_ns::resolution): Don't return less than 1.
> Index: winsup/cygwin/times.cc
> ===================================================================
> RCS file: /cvs/src/src/winsup/cygwin/times.cc,v
> retrieving revision 1.112
> diff -p -u -r1.112 times.cc
> --- winsup/cygwin/times.cc 3 Dec 2011 21:43:27 -0000 1.112
> +++ winsup/cygwin/times.cc 12 Dec 2011 08:23:20 -0000
> @@ -718,7 +718,7 @@ hires_ns::resolution ()
> return (long long) -1;
> }
>
> - return (LONGLONG) freq;
> + return (freq <= 1.0) ? 1ll : (LONGLONG) freq;
> }
>
> UINT
Thanks, applied.
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat