[gnome-software/1405-rpm-ostree-don-t-show-transaction-in-progress-error] Apply 3 suggestion(s) to 1 file(s)



commit c41661ae93a26dbf540b5d497fe082326b6f6724
Author: Philip Withnall <philip tecnocode co uk>
Date:   Tue Sep 21 12:10:54 2021 +0000

    Apply 3 suggestion(s) to 1 file(s)

 plugins/rpm-ostree/gs-plugin-rpm-ostree.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/plugins/rpm-ostree/gs-plugin-rpm-ostree.c b/plugins/rpm-ostree/gs-plugin-rpm-ostree.c
index 43f4c1875..f1581b8f3 100644
--- a/plugins/rpm-ostree/gs-plugin-rpm-ostree.c
+++ b/plugins/rpm-ostree/gs-plugin-rpm-ostree.c
@@ -552,6 +552,11 @@ out:
        return success;
 }
 
+/* FIXME: Refactor this once rpmostree returns a specific error code
+ * for ‘transaction in progress’, to avoid the slight race here where
+ * gnome-software could return from this function just as another client
+ * starts a new transaction.
+ * https://github.com/coreos/rpm-ostree/issues/3070 */
 static gboolean
 gs_rpmostree_wait_for_ongoing_transaction_end (GsRPMOSTreeSysroot *sysroot_proxy,
                                               GCancellable *cancellable,
@@ -588,10 +593,8 @@ gs_rpmostree_wait_for_ongoing_transaction_end (GsRPMOSTreeSysroot *sysroot_proxy
                g_main_context_iteration (main_context, TRUE);
        }
 
-       if (notify_handler != 0)
-               g_signal_handler_disconnect (sysroot_proxy, notify_handler);
-       if (cancelled_handler != 0)
-               g_signal_handler_disconnect (cancellable, cancelled_handler);
+       g_clear_signal_handler (&notify_handler, sysroot_proxy);
+       g_clear_signal_handler (&cancelled_handler, cancellable);
 
        gs_rpmostree_error_convert (error);
 


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