]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
locale-setup: do not load locale from environemnt when /etc/locale.conf is unchanged
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 28 Dec 2024 06:07:31 +0000 (15:07 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Sat, 28 Dec 2024 12:04:01 +0000 (12:04 +0000)
Previously, when /etc/locale.conf is unchanged, locales were loaded from
possibly outdated environment variable.

Fixes a bug introduced by 018befcff6b51f8a50ca232e1984d34526037241 (v253).
Fixes #35717.

src/shared/locale-setup.c

index 4e7f486a237a660ee24324cc3be7079b135b7775..5c4580cffff38e3896687f6278b98e93e24d03e1 100644 (file)
@@ -75,7 +75,7 @@ static int locale_context_load_conf(LocaleContext *c, LocaleLoadFlag flag) {
 
         /* If the file is not changed, then we do not need to re-read the file. */
         if (stat_inode_unmodified(&c->st, &st))
-                return 0;
+                return 1; /* (already) loaded */
 
         c->st = st;
         locale_context_clear(c);