env-util: make write_env_file() optionally take headers

This also makes write_env_file() and write_env_file_label() optionally
take dir_fd, and drop write_env_file_at().

Preparation for later commits.
This commit is contained in:
Yu Watanabe
2023-10-31 17:15:21 +09:00
parent 78101ca9cc
commit f155cb6d75
10 changed files with 19 additions and 16 deletions
+2 -2
View File
@@ -446,7 +446,7 @@ static int process_locale(int rfd) {
locales[i] = NULL;
r = write_env_file_at(pfd, f, locales);
r = write_env_file(pfd, f, NULL, locales);
if (r < 0)
return log_error_errno(r, "Failed to write /etc/locale.conf: %m");
@@ -534,7 +534,7 @@ static int process_keymap(int rfd) {
keymap = STRV_MAKE(strjoina("KEYMAP=", arg_keymap));
r = write_env_file_at(pfd, f, keymap);
r = write_env_file(pfd, f, NULL, keymap);
if (r < 0)
return log_error_errno(r, "Failed to write /etc/vconsole.conf: %m");