neil / rpms / udisks2

Forked from rpms/udisks2 a year ago
Clone

Blame SOURCES/udisks-2.10.0-udiskslinuxpartition_GError.patch

598898
From 7c9933c0f80faaabbed607983fdf77f8c4562df6 Mon Sep 17 00:00:00 2001
598898
From: Tomas Bzatek <tbzatek@redhat.com>
598898
Date: Sat, 1 Jan 2022 20:11:57 +0100
598898
Subject: [PATCH] udiskslinuxpartition: Fix GError ownership
598898
598898
---
598898
 src/udiskslinuxpartition.c | 15 ++++++---------
598898
 1 file changed, 6 insertions(+), 9 deletions(-)
598898
598898
diff --git a/src/udiskslinuxpartition.c b/src/udiskslinuxpartition.c
598898
index 5461b3903..3d970768d 100644
598898
--- a/src/udiskslinuxpartition.c
598898
+++ b/src/udiskslinuxpartition.c
598898
@@ -135,8 +135,7 @@ check_authorization (UDisksPartition       *partition,
598898
                                                caller_uid,
598898
                                                &error))
598898
     {
598898
-      g_dbus_method_invocation_return_gerror (invocation, error);
598898
-      g_clear_error (&error);
598898
+      g_dbus_method_invocation_take_error (invocation, error);
598898
       goto out;
598898
     }
598898
 
598898
@@ -351,7 +350,7 @@ handle_set_flags (UDisksPartition       *partition,
598898
   object = udisks_daemon_util_dup_object (partition, &error);
598898
   if (object == NULL)
598898
     {
598898
-      g_dbus_method_invocation_take_error (invocation, error);
598898
+      g_dbus_method_invocation_return_gerror (invocation, error);
598898
       goto out;
598898
     }
598898
 
598898
@@ -499,7 +498,7 @@ handle_set_name (UDisksPartition       *partition,
598898
   object = udisks_daemon_util_dup_object (partition, &error);
598898
   if (object == NULL)
598898
     {
598898
-      g_dbus_method_invocation_take_error (invocation, error);
598898
+      g_dbus_method_invocation_return_gerror (invocation, error);
598898
       goto out;
598898
     }
598898
 
598898
@@ -873,7 +872,7 @@ handle_resize (UDisksPartition       *partition,
598898
   object = udisks_daemon_util_dup_object (partition, &error);
598898
   if (object == NULL)
598898
     {
598898
-      g_dbus_method_invocation_take_error (invocation, error);
598898
+      g_dbus_method_invocation_return_gerror (invocation, error);
598898
       goto out;
598898
     }
598898
 
598898
@@ -994,7 +993,7 @@ handle_delete (UDisksPartition       *partition,
598898
   object = udisks_daemon_util_dup_object (partition, &error);
598898
   if (object == NULL)
598898
     {
598898
-      g_dbus_method_invocation_take_error (invocation, error);
598898
+      g_dbus_method_invocation_return_gerror (invocation, error);
598898
       goto out;
598898
     }
598898
 
598898
@@ -1012,9 +1011,7 @@ handle_delete (UDisksPartition       *partition,
598898
       if (!udisks_linux_block_teardown (block, invocation, options, &error))
598898
         {
598898
           if (invocation != NULL)
598898
-            g_dbus_method_invocation_take_error (invocation, error);
598898
-          else
598898
-            g_clear_error (&error);
598898
+            g_dbus_method_invocation_return_gerror (invocation, error);
598898
           goto out;
598898
         }
598898
     }