bootloader: fdatasync() bootloader configuration

Let's be a bit more conservative here and actually fdatasync() the
configurations we're generating.

I'm seeing an issue at the moment where syslinux isn't finding the
config sometimes, and while I don't think this is the issue, let's try
it.
This commit is contained in:
Colin Walters committed 2014-04-03 22:32:30 -04:00
1 parent cc8bacf8b4
commit 829e0382ab
4 files changed
+82 -10

No files matched your search

+8 -5
View File
@@ -124,12 +124,15 @@ _ostree_bootloader_uboot_write_config (OstreeBootloader *bootloader,
return FALSE;
new_config_contents = _ostree_sysroot_join_lines (new_lines);
{
gs_unref_bytes GBytes *new_config_contents_bytes =
g_bytes_new_static (new_config_contents,
strlen (new_config_contents));
if (!g_file_replace_contents (new_config_path, new_config_contents,
strlen (new_config_contents),
NULL, FALSE, G_FILE_CREATE_NONE,
NULL, cancellable, error))
return FALSE;
if (!ot_gfile_replace_contents_fsync (new_config_path, new_config_contents_bytes,
cancellable, error))
return FALSE;
}
return TRUE;
}