Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b70999d

Browse files
committed
Make TZNAME_GLOBAL for reference to tzname global variable.
1 parent f62901c commit b70999d

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/include/port.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $PostgreSQL: pgsql/src/include/port.h,v 1.58 2004/09/08 19:43:07 momjian Exp $
9+
* $PostgreSQL: pgsql/src/include/port.h,v 1.59 2004/09/09 00:24:10 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -183,9 +183,10 @@ extern int win32_open(const char *, int,...);
183183
/* Global variable holding time zone information. */
184184
#if !defined(__CYGWIN__)
185185
#define TIMEZONE_GLOBAL timezone
186+
#define TZNAME_GLOBAL tzname
186187
#else
187188
#define TIMEZONE_GLOBAL _timezone
188-
#define tzname _tzname /* should be in time.h? */
189+
#define TZNAME_GLOBAL _tzname
189190
#endif
190191

191192
extern int copydir(char *fromdir, char *todir);

src/interfaces/ecpg/pgtypeslib/dt_common.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1065,8 +1065,8 @@ abstime2tm(AbsoluteTime _time, int *tzp, struct tm * tm, char **tzn)
10651065
* case it contains an error message, which doesn't fit in the
10661066
* buffer
10671067
*/
1068-
StrNCpy(*tzn, tzname[tm->tm_isdst], MAXTZLEN + 1);
1069-
if (strlen(tzname[tm->tm_isdst]) > MAXTZLEN)
1068+
StrNCpy(*tzn, TZNAME_GLOBAL[tm->tm_isdst], MAXTZLEN + 1);
1069+
if (strlen(TZNAME_GLOBAL[tm->tm_isdst]) > MAXTZLEN)
10701070
tm->tm_isdst = -1;
10711071
}
10721072
}

src/interfaces/ecpg/pgtypeslib/timestamp.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ timestamp2tm(timestamp dt, int *tzp, struct tm * tm, fsec_t *fsec, char **tzn)
223223
#elif defined(HAVE_INT_TIMEZONE)
224224
*tzp = ((tm->tm_isdst > 0) ? (TIMEZONE_GLOBAL - 3600) : TIMEZONE_GLOBAL);
225225
if (tzn != NULL)
226-
*tzn = tzname[(tm->tm_isdst > 0)];
226+
*tzn = TZNAME_GLOBAL[(tm->tm_isdst > 0)];
227227
#endif
228228

229229
#else /* not (HAVE_TM_ZONE || HAVE_INT_TIMEZONE) */

0 commit comments

Comments
 (0)