core: Further unify API to create files

We now have just one place which writes to the filesystem.  Wrap a
temporary file allocation API on top of that.
This commit is contained in:
Colin Walters committed 2011-12-02 13:42:25 -05:00
1 parent c7235182a4
commit d1950da1a0
5 files changed
+224 -166

No files matched your search

+4 -8
View File
@@ -592,14 +592,10 @@ stage_and_checksum (OstreeRepo *self,
break;
}
if (!ot_gfile_create_tmp (priv->tmp_dir, prefix, NULL, 0666,
&tmp_f, &stream, cancellable, error))
goto out;
if (!ot_gio_splice_and_checksum (stream, input, &ret_checksum, cancellable, error))
goto out;
if (!g_output_stream_close ((GOutputStream*)stream, NULL, error))
if (!ostree_create_temp_file_from_input (priv->tmp_dir, prefix, NULL, NULL,
NULL, input, OSTREE_OBJECT_TYPE_META,
&tmp_f, &ret_checksum,
cancellable, error))
goto out;
ret_tmpname = g_file_get_child (priv->tmp_dir, g_checksum_get_string (ret_checksum));