]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
rpc: mark source returned by virEventGLibAddSocketWatch as unused
authorJán Tomko <jtomko@redhat.com>
Fri, 3 Sep 2021 14:36:54 +0000 (16:36 +0200)
committerJán Tomko <jtomko@redhat.com>
Wed, 8 Sep 2021 14:19:55 +0000 (16:19 +0200)
Two users of virEventGLibAddSocketWatch care about the GSource
it returns.

The other three free it by assigning it to an autofreed variable.

Mark them with G_GNUC_UNUSED to make this obvious to the reader
and the compiler.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/rpc/virnetclient.c

index ffe2f343f9168366b8500193b317baae68420a43..f526ad89ec8f407e728a5f208f86121907e8b032 100644 (file)
@@ -882,7 +882,7 @@ virNetClientIOEventTLS(int fd,
 static gboolean
 virNetClientTLSHandshake(virNetClient *client)
 {
-    g_autoptr(GSource) source = NULL;
+    g_autoptr(GSource) G_GNUC_UNUSED source = NULL;
     GIOCondition ev;
     int ret;
 
@@ -939,7 +939,7 @@ int virNetClientSetTLSSession(virNetClient *client,
     int ret;
     char buf[1];
     int len;
-    g_autoptr(GSource) source = NULL;
+    g_autoptr(GSource) G_GNUC_UNUSED source = NULL;
 
 #ifndef WIN32
     sigset_t oldmask, blockedsigs;
@@ -1664,7 +1664,7 @@ static int virNetClientIOEventLoop(virNetClient *client,
 #endif /* !WIN32 */
         int timeout = -1;
         virNetMessage *msg = NULL;
-        g_autoptr(GSource) source = NULL;
+        g_autoptr(GSource) G_GNUC_UNUSED source = NULL;
         GIOCondition ev = 0;
         struct virNetClientIOEventData data = {
             .client = client,