Add defense against possibility that tzname[] doesn't exist.
authorTom Lane
Thu, 22 May 2003 17:13:08 +0000 (17:13 +0000)
committerTom Lane
Thu, 22 May 2003 17:13:08 +0000 (17:13 +0000)
src/backend/commands/variable.c

index aa8d9d361347f63bc6ce0933d63fe0d274dd514e..77fd47bee97f2d84bdbe3101324225dbdad4c7d0 100644 (file)
@@ -9,7 +9,7 @@
  *
  *
  * 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 $
  *
  *-------------------------------------------------------------------------
  */
 #include "utils/tqual.h"
 #include "mb/pg_wchar.h"
 
+/*
+ * Some systems have tzname[] but don't declare it in .  Use this
+ * to duplicate the test in AC_STRUCT_TIMEZONE.
+ */
+#ifdef HAVE_TZNAME
+#ifndef tzname /* For SGI.  */
+extern char *tzname[];
+#endif
+#endif
+
+
 /*
  * DATESTYLE
  */
@@ -325,8 +336,10 @@ tzset_succeeded(const char *tz)
    /*
     * Check first set of heuristics to say that tzset definitely worked.
     */
+#ifdef HAVE_TZNAME
    if (tzname[1] && tzname[1][0] != '\0')
        return true;
+#endif
    if (TIMEZONE_GLOBAL != 0)
        return true;