aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/pg_locale.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/adt/pg_locale.c')
-rw-r--r--src/backend/utils/adt/pg_locale.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c
index 48b7e16d81b..643cca05d38 100644
--- a/src/backend/utils/adt/pg_locale.c
+++ b/src/backend/utils/adt/pg_locale.c
@@ -826,6 +826,7 @@ cache_locale_time(void)
char *bufptr;
time_t timenow;
struct tm *timeinfo;
+ struct tm timeinfobuf;
bool strftimefail = false;
int encoding;
int i;
@@ -876,7 +877,7 @@ cache_locale_time(void)
/* We use times close to current time as data for strftime(). */
timenow = time(NULL);
- timeinfo = localtime(&timenow);
+ timeinfo = gmtime_r(&timenow, &timeinfobuf);
/* Store the strftime results in MAX_L10N_DATA-sized portions of buf[] */
bufptr = buf;