[ostree] static-delta: Set error on bsdiff failure



commit 60e5529ba0143e6bf4e204fd00f7989d0f3c57c5
Author: John Hiesey <john hiesey com>
Date:   Thu Oct 1 17:26:47 2015 -0700

    static-delta: Set error on bsdiff failure
    
    bsdiff can fail when generating static deltas, particularly if
    not enough memory is available. Set error properly when this happens.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756260

 .../ostree-repo-static-delta-compilation.c         |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/libostree/ostree-repo-static-delta-compilation.c 
b/src/libostree/ostree-repo-static-delta-compilation.c
index 063c408..c63942f 100644
--- a/src/libostree/ostree-repo-static-delta-compilation.c
+++ b/src/libostree/ostree-repo-static-delta-compilation.c
@@ -829,8 +829,10 @@ process_one_bsdiff (OstreeRepo                       *repo,
       op.cancellable = cancellable;
       op.error = error;
       stream.opaque = &op;
-      if (bsdiff (tmp_from_buf, tmp_from_len, tmp_to_buf, tmp_to_len, &stream) < 0)
+      if (bsdiff (tmp_from_buf, tmp_from_len, tmp_to_buf, tmp_to_len, &stream) < 0) {
+        g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "bsdiff generation failed");
         goto out;
+      }
 
       payload = g_memory_output_stream_get_data (G_MEMORY_OUTPUT_STREAM (out));
       payload_size = g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (out));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]