summaryrefslogtreecommitdiffstats
path: root/src/firstboot
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2017-11-25 11:11:57 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2017-11-25 11:11:57 +0100
commita7353b4d1450accd189e848a5355693f026542f1 (patch)
tree096a5a166c6d776c5cd3f372d213c71e432fe202 /src/firstboot
parentmachine: remove unused variables (diff)
downloadsystemd-a7353b4d1450accd189e848a5355693f026542f1.tar.xz
systemd-a7353b4d1450accd189e848a5355693f026542f1.zip
firstboot: do not write vconsole.conf when arg_keymap is empty
Diffstat (limited to 'src/firstboot')
-rw-r--r--src/firstboot/firstboot.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c
index afbfa3743d..207ddeb70f 100644
--- a/src/firstboot/firstboot.c
+++ b/src/firstboot/firstboot.c
@@ -346,13 +346,15 @@ static int process_keymap(void) {
if (r < 0)
return r;
- if (!isempty(arg_keymap))
- keymap = STRV_MAKE(strjoina("KEYMAP=", arg_keymap));
-
- if (!keymap)
+ if (isempty(arg_keymap))
return 0;
- mkdir_parents(etc_vconsoleconf, 0755);
+ keymap = STRV_MAKE(strjoina("KEYMAP=", arg_keymap));
+
+ r = mkdir_parents(etc_vconsoleconf, 0755);
+ if (r < 0)
+ return log_error_errno(r, "Failed to create the parent directory of %s: %m", etc_vconsoleconf);
+
r = write_env_file(etc_vconsoleconf, keymap);
if (r < 0)
return log_error_errno(r, "Failed to write %s: %m", etc_vconsoleconf);