Add defense against possibility that tzname[] doesn't exist.
This commit is contained in:
parent
dbd55d3a5b
commit
cef0652a3d
@ -9,7 +9,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/variable.c,v 1.76 2003/05/18 01:06:25 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/variable.c,v 1.77 2003/05/22 17:13:08 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -29,6 +29,17 @@
|
|||||||
#include "utils/tqual.h"
|
#include "utils/tqual.h"
|
||||||
#include "mb/pg_wchar.h"
|
#include "mb/pg_wchar.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Some systems have tzname[] but don't declare it in <time.h>. Use this
|
||||||
|
* to duplicate the test in AC_STRUCT_TIMEZONE.
|
||||||
|
*/
|
||||||
|
#ifdef HAVE_TZNAME
|
||||||
|
#ifndef tzname /* For SGI. */
|
||||||
|
extern char *tzname[];
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DATESTYLE
|
* DATESTYLE
|
||||||
*/
|
*/
|
||||||
@ -325,8 +336,10 @@ tzset_succeeded(const char *tz)
|
|||||||
/*
|
/*
|
||||||
* Check first set of heuristics to say that tzset definitely worked.
|
* Check first set of heuristics to say that tzset definitely worked.
|
||||||
*/
|
*/
|
||||||
|
#ifdef HAVE_TZNAME
|
||||||
if (tzname[1] && tzname[1][0] != '\0')
|
if (tzname[1] && tzname[1][0] != '\0')
|
||||||
return true;
|
return true;
|
||||||
|
#endif
|
||||||
if (TIMEZONE_GLOBAL != 0)
|
if (TIMEZONE_GLOBAL != 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user