[ostree] pull: Properly propagate errors



commit 7cce6e5ba1c4de48ec6bfd76d9fb2a12cff13c33
Author: Colin Walters <walters verbum org>
Date:   Wed Jun 20 15:42:41 2012 -0400

    pull: Properly propagate errors

 src/ostree/ostree-pull.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/ostree/ostree-pull.c b/src/ostree/ostree-pull.c
index a7be92d..156facf 100644
--- a/src/ostree/ostree-pull.c
+++ b/src/ostree/ostree-pull.c
@@ -185,11 +185,15 @@ check_outstanding_requests_handle_error (OtPullData          *pull_data,
     g_main_loop_quit (pull_data->loop);
   if (error)
     {
-      pull_data->caught_error = TRUE;
-      if (pull_data->async_error)
-        g_error_free (error);
+      if (!pull_data->caught_error)
+        {
+          pull_data->caught_error = TRUE;
+          g_propagate_error (pull_data->async_error, error);
+        }
       else
-        g_propagate_error (pull_data->async_error, error);
+        {
+          g_error_free (error);
+        }
     }
 }
 



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