Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Subject: Re: Bug affecting postgres now() function - more info and offer to fix cygwin bug...
From: Sean McCune <sean@redhandsoftware.com>
To: cygwin@cygwin.com
In-Reply-To: <20040701113737.GD1389@cygbert.vinschen.de>
References: <1088347078.16132.21.camel@verona.mccinternal.com> <1088478284.13417.31.camel@verona.mccinternal.com> <20040701113737.GD1389@cygbert.vinschen.de>
Content-Type: text/plain
Organization: Red Hand Software, Inc.
Message-Id: <1088693909.27964.2.camel@verona.mccinternal.com>
Mime-Version: 1.0
Date: Thu, 01 Jul 2004 10:58:30 -0400
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

Great!  I was going to start work on a fix, too, but ran into cygwin
building problems, so you beat me to it.  Thanks!

I have the snapshot running.  And postgres is keeping time.  I haven't
looked at your source yet, but I assume there's still an independent
counter running and you're resetting the base time it counts from.  If
this is so, I don't really have a way to test the wrap-around other than
to let it run for 50 days and see if it works.  :) 


On Thu, 2004-07-01 at 07:37, Corinna Vinschen wrote:
> On Jun 28 23:04, Sean McCune wrote:
> > More useful info: (and yes I'm replying to my own message)
> > 
> > I spelunked through the source code and found this in times.cc:
> > 
> > LONGLONG
> > hires_ms::usecs (bool justdelta)
> > {
> >   if (!minperiod) /* NO_COPY variable */
> >     prime ();
> >   DWORD now = timeGetTime ();
> >   // FIXME: Not sure how this will handle the 49.71 day wrap around
> >   LONGLONG res = initime_us.QuadPart + ((LONGLONG) (now - initime_ms) *
> > 1000);
> >   return res;
> > }
> 
> I've checked in a potential fix.  Could you try the latest Cygwin snapshot
> from http://cygwin.com/snapshots.html ?
> 
> Thanks,
> Corinna
-- 
Sean McCune
Red Hand Software, Inc.
sean@redhandsoftware.com


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

