diff options
author | Lennart Poettering <lennart@poettering.net> | 2020-04-30 18:32:44 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2020-05-07 17:24:22 +0200 |
commit | a00a78b84e2ab352b3144bfae8bc578d172303be (patch) | |
tree | f45bdab5db60c30378615ec603b82c7d9c088541 /src/home/homectl.c | |
parent | test: add test case for locale_is_installed() (diff) | |
download | systemd-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.c | 3 |
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"); |