From 43cd776d7dc8ac573262f8459edeb1c1f5f3cd09 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 7 Mar 2024 16:18:32 -0500 Subject: xtime: Call tzset() from main() instead of lazily POSIX specifies[1] that If a thread accesses tzname, daylight, or timezone directly while another thread is in a call to tzset(), or to any function that is required or allowed to set timezone information as if by calling tzset(), the behavior is undefined. So calling it lazily from arbitrary threads is risky. [1]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/tzset.html --- tests/bfstd.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'tests/bfstd.c') diff --git a/tests/bfstd.c b/tests/bfstd.c index 4d0ec23..0ded5de 100644 --- a/tests/bfstd.c +++ b/tests/bfstd.c @@ -43,11 +43,6 @@ static bool check_wordesc(const char *str, const char *exp, enum wesc_flags flag bool check_bfstd(void) { bool ret = true; - // Try to set a UTF-8 locale - if (!setlocale(LC_ALL, "C.UTF-8")) { - setlocale(LC_ALL, ""); - } - // From man 3p basename ret &= check_base_dir("usr", ".", "usr"); ret &= check_base_dir("usr/", ".", "usr"); -- cgit v1.2.3