diff options
Diffstat (limited to 'src/firstboot')
-rw-r--r-- | src/firstboot/firstboot.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c index b3578d3e16..586674d458 100644 --- a/src/firstboot/firstboot.c +++ b/src/firstboot/firstboot.c @@ -411,7 +411,8 @@ static int process_hostname(void) { return 0; mkdir_parents(etc_hostname, 0755); - r = write_string_file(etc_hostname, arg_hostname, WRITE_STRING_FILE_CREATE); + r = write_string_file(etc_hostname, arg_hostname, + WRITE_STRING_FILE_CREATE | WRITE_STRING_FILE_SYNC); if (r < 0) return log_error_errno(r, "Failed to write %s: %m", etc_hostname); @@ -432,7 +433,8 @@ static int process_machine_id(void) { return 0; mkdir_parents(etc_machine_id, 0755); - r = write_string_file(etc_machine_id, sd_id128_to_string(arg_machine_id, id), WRITE_STRING_FILE_CREATE); + r = write_string_file(etc_machine_id, sd_id128_to_string(arg_machine_id, id), + WRITE_STRING_FILE_CREATE | WRITE_STRING_FILE_SYNC); if (r < 0) return log_error_errno(r, "Failed to write machine id: %m"); @@ -503,7 +505,7 @@ static int write_root_shadow(const char *path, const struct spwd *p) { if (putspent(p, f) != 0) return errno > 0 ? -errno : -EIO; - return fflush_and_check(f); + return fflush_sync_and_check(f); } static int process_root_password(void) { |