Re: git cherry-pick timestamping issue - Mailing list pgsql-hackers

From Tom Lane
Subject Re: git cherry-pick timestamping issue
Date
Msg-id 1745.1285341790@sss.pgh.pa.us
Whole thread Raw
In response to git cherry-pick timestamping issue  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I wrote:
> Apparently somebody's confused between local and GMT time somewhere in
> there.

For the archives' sake: this turns out to be a portability issue not
handled by the git code.  If you are running on a platform old enough
to have gmtime_r returning int rather than struct tm *, you need this
patch:

*** date.c~    Sat Sep 18 19:43:54 2010
--- date.c    Fri Sep 24 10:57:28 2010
***************
*** 406,412 ****     case '.':         now = time(NULL);         refuse_future = NULL;
!         if (gmtime_r(&now, &now_tm))             refuse_future = &now_tm;          if (num > 70) {
--- 406,412 ----     case '.':         now = time(NULL);         refuse_future = NULL;
!         if (gmtime_r(&now, &now_tm) == 0)             refuse_future = &now_tm;          if (num > 70) {
***************
*** 469,475 ****      */     if (num >= 100000000 && nodate(tm)) {         time_t time = num;
!         if (gmtime_r(&time, tm)) {             *tm_gmt = 1;             return end - date;         }
--- 469,475 ----      */     if (num >= 100000000 && nodate(tm)) {         time_t time = num;
!         if (gmtime_r(&time, tm) == 0) {             *tm_gmt = 1;             return end - date;         }


[ /me resolves to actually run a program's regression tests before
assuming it works ]
        regards, tom lane


pgsql-hackers by date:

Previous
From: Dave Page
Date:
Subject: Re: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running
Next
From: André Fernandes
Date:
Subject: Re: Name column