lib: Use OtTmpFile for static delta processing

The `OstreeRepoContentBareCommit` struct was basically an `OtTmpFile`, so let's
make it one. I moved the "convert to `GOutputStream`" logic into the callers,
since that bit can't fail; it makes the implementation much simpler since we can
just return the result of `ot_open_tmpfile_linkable_at()`.

Prep for `GLnxTmpfile` porting.

Closes: #957
Approved by: jlebon
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2017-06-26 17:17:32 +00:00
1 parent 4dee1984dc
commit af3a96755b
4 files changed
+45 -71

No files matched your search

+3 -9
View File
@@ -23,7 +23,7 @@
#include "ostree-ref.h"
#include "ostree-repo.h"
#include "ostree-remote-private.h"
#include "libglnx.h"
#include "otutil.h"
G_BEGIN_DECLS
@@ -305,17 +305,11 @@ _ostree_repo_commit_loose_final (OstreeRepo *self,
GCancellable *cancellable,
GError **error);
typedef struct {
int fd;
char *temp_filename;
} OstreeRepoContentBareCommit;
gboolean
_ostree_repo_open_content_bare (OstreeRepo *self,
const char *checksum,
guint64 content_len,
OstreeRepoContentBareCommit *out_state,
GOutputStream **out_stream,
OtTmpfile *out_tmpf,
gboolean *out_have_object,
GCancellable *cancellable,
GError **error);
@@ -323,7 +317,7 @@ _ostree_repo_open_content_bare (OstreeRepo *self,
gboolean
_ostree_repo_commit_trusted_content_bare (OstreeRepo *self,
const char *checksum,
OstreeRepoContentBareCommit *state,
OtTmpfile *tmpf,
guint32 uid,
guint32 gid,
guint32 mode,