diff options
author | Colin Walters <walters@verbum.org> | 2012-05-03 19:57:05 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2012-05-03 19:59:13 -0400 |
commit | 67f61976f4271a014213693b2da5cc738d5cad6a (patch) | |
tree | e8e0464287ae90092e18a438180940295e3aec55 /src/libostree/ostree-chain-input-stream.c | |
parent | 99cb8a80fac934e09028984ea6a472e35d16e9a4 (diff) | |
download | ostree-67f61976f4271a014213693b2da5cc738d5cad6a.tar.gz |
core: Clean up object storage API
Rather than passing xattr/file_info for all objects, change the API to
assume we're passing the defined object stream for each type. Namely,
for OSTREE_OBJECT_TYPE_FILE, we're now giving the "archive file" data.
This significantly cleans up the code for committing to archive mode
repositories, at the cost of having to (at present) create an
intermediate temporary file when committing to raw repositories.
Diffstat (limited to 'src/libostree/ostree-chain-input-stream.c')
-rw-r--r-- | src/libostree/ostree-chain-input-stream.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/libostree/ostree-chain-input-stream.c b/src/libostree/ostree-chain-input-stream.c index b875e075..fa00e374 100644 --- a/src/libostree/ostree-chain-input-stream.c +++ b/src/libostree/ostree-chain-input-stream.c @@ -175,15 +175,18 @@ ostree_chain_input_stream_read (GInputStream *stream, if (self->priv->index >= self->priv->streams->len) return 0; - child = self->priv->streams->pdata[self->priv->index]; - - res = g_input_stream_read (child, - buffer, - count, - cancellable, - error); - if (res == 0) - self->priv->index++; + res = 0; + while (res == 0 && self->priv->index < self->priv->streams->len) + { + child = self->priv->streams->pdata[self->priv->index]; + res = g_input_stream_read (child, + buffer, + count, + cancellable, + error); + if (res == 0) + self->priv->index++; + } return res; } |