[ostree: 69/70] static-delta: Initialize read_source_fd to -1
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree: 69/70] static-delta: Initialize read_source_fd to -1
- Date: Fri, 15 Apr 2016 21:07:03 +0000 (UTC)
commit b4b26907c8e873eae3a35d72f01f349c61585333
Author: Alexander Larsson <alexl redhat com>
Date: Fri Apr 15 10:01:42 2016 +0200
static-delta: Initialize read_source_fd to -1
If not, we'll get ESPIPE when seeking on fd 0.
Closes: #260
Approved by: cgwalters
.../ostree-repo-static-delta-processing.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/libostree/ostree-repo-static-delta-processing.c
b/src/libostree/ostree-repo-static-delta-processing.c
index 6c5dd46..681d426 100644
--- a/src/libostree/ostree-repo-static-delta-processing.c
+++ b/src/libostree/ostree-repo-static-delta-processing.c
@@ -106,6 +106,12 @@ OPPROTO(close)
OPPROTO(bspatch)
#undef OPPROTO
+static void
+static_delta_execution_state_init (StaticDeltaExecutionState *state)
+{
+ state->read_source_fd = -1;
+}
+
static gboolean
read_varuint64 (StaticDeltaExecutionState *state,
guint64 *out_value,
@@ -195,6 +201,8 @@ _ostree_static_delta_part_execute (OstreeRepo *repo,
StaticDeltaExecutionState *state = &statedata;
guint n_executed = 0;
+ static_delta_execution_state_init (&statedata);
+
state->repo = repo;
state->async_error = error;
state->trusted = trusted;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]