git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 474d7a1) | patch
Use thread-safe strftime_l() instead of strftime().
2025年3月28日 06:13:43 +0000 (07:13 +0100)
2025年3月28日 06:13:43 +0000 (07:13 +0100)
commit 890fc826c91f153ae8c084d3a008f91798495b13
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
src/backend/main/main.c diff | blob | blame | history
src/backend/utils/adt/pg_locale.c diff | blob | blame | history
src/backend/utils/adt/pg_locale_libc.c diff | blob | blame | history
src/include/utils/pg_locale.h diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /