summaryrefslogtreecommitdiff
path: root/src/backend/main/main.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2025-03-28 07:13:43 +0100
committerPeter Eisentraut <peter@eisentraut.org>2025-03-28 07:13:43 +0100
commit890fc826c91f153ae8c084d3a008f91798495b13 (patch)
tree04a22ef76d8421bc08ede090e7e41547866c54e9 /src/backend/main/main.c
parent474d7a1fd858d5ee138cf4504dcd93a9a3123a7d (diff)
Use thread-safe strftime_l() instead of strftime().
This removes some setlocale() calls and a lot of commentary about how dangerous that is. strftime_l() is from POSIX 2008, and on Windows we use _wcsftime_l(). While here, adjust error message for strftime_l() failure: it does not in practice set errno (even though POSIX says it could), so no %m. Author: Thomas Munro <thomas.munro@gmail.com> Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi> Reviewed-by: Peter Eisentraut <peter@eisentraut.org> Discussion: https://postgr.es/m/CA%2BhUKGJqVe0%2BPv9dvC9dSums_PXxGo9SWcxYAMBguWJUGbWz-A%40mail.gmail.com
Diffstat (limited to 'src/backend/main/main.c')
-rw-r--r--src/backend/main/main.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/backend/main/main.c b/src/backend/main/main.c
index e8effe50242..7d63cf94a6b 100644
--- a/src/backend/main/main.c
+++ b/src/backend/main/main.c
@@ -142,10 +142,7 @@ main(int argc, char *argv[])
init_locale("LC_MESSAGES", LC_MESSAGES, "");
#endif
- /*
- * We keep these set to "C" always, except transiently in pg_locale.c; see
- * that file for explanations.
- */
+ /* We keep these set to "C" always. See pg_locale.c for explanation. */
init_locale("LC_MONETARY", LC_MONETARY, "C");
init_locale("LC_NUMERIC", LC_NUMERIC, "C");
init_locale("LC_TIME", LC_TIME, "C");