summaryrefslogtreecommitdiffstats
path: root/src/home/homectl.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-04-30 18:32:44 +0200
committerLennart Poettering <lennart@poettering.net>2020-05-07 17:24:22 +0200
commita00a78b84e2ab352b3144bfae8bc578d172303be (patch)
treef45bdab5db60c30378615ec603b82c7d9c088541 /src/home/homectl.c
parenttest: add test case for locale_is_installed() (diff)
downloadsystemd-a00a78b84e2ab352b3144bfae8bc578d172303be.tar.xz
systemd-a00a78b84e2ab352b3144bfae8bc578d172303be.zip
tree-wide: port various bits over to locale_is_installed()
Diffstat (limited to 'src/home/homectl.c')
-rw-r--r--src/home/homectl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/home/homectl.c b/src/home/homectl.c
index c98bf8b540..e1857b6923 100644
--- a/src/home/homectl.c
+++ b/src/home/homectl.c
@@ -2807,6 +2807,9 @@ static int parse_argv(int argc, char *argv[]) {
if (!locale_is_valid(optarg))
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Locale '%s' is not valid.", optarg);
+ if (locale_is_installed(optarg) <= 0)
+ log_warning("Locale '%s' is not installed, accepting anyway.", optarg);
+
r = json_variant_set_field_string(&arg_identity_extra, "preferredLanguage", optarg);
if (r < 0)
return log_error_errno(r, "Failed to set preferredLanguage field: %m");