Blame SOURCES/0006-conn-Remove-redundant-vnc_connection_has_error-calls.patch

d1efb8
From 74fcc039b313a0d3b91d15b83b4d4df4aa84536e Mon Sep 17 00:00:00 2001
d1efb8
From: Christophe Fergeau <cfergeau@redhat.com>
d1efb8
Date: Wed, 9 Jan 2019 14:01:25 +0100
d1efb8
Subject: [PATCH] conn: Remove redundant vnc_connection_has_error() calls
d1efb8
d1efb8
No need to call it twice in:
d1efb8
if (vnc_connection_has_error(conn))
d1efb8
    return !vnc_connection_has_error(conn);
d1efb8
d1efb8
and no need to call it after calling vnc_connection_set_error() as it
d1efb8
will always return TRUE in this scenario.
d1efb8
d1efb8
Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
d1efb8
(cherry picked from commit 247eaddd7455ee4eb80efe4971167ab0636a4509)
d1efb8
Resolves: rhbz#1688275
d1efb8
---
d1efb8
 src/vncconnection.c | 12 ++++++------
d1efb8
 1 file changed, 6 insertions(+), 6 deletions(-)
d1efb8
d1efb8
diff --git a/src/vncconnection.c b/src/vncconnection.c
d1efb8
index 65111fd..fd7468b 100644
d1efb8
--- a/src/vncconnection.c
d1efb8
+++ b/src/vncconnection.c
d1efb8
@@ -3120,7 +3120,7 @@ static gboolean vnc_connection_framebuffer_update(VncConnection *conn, gint32 et
d1efb8
               etype, width, height, x, y);
d1efb8
 
d1efb8
     if (vnc_connection_has_error(conn))
d1efb8
-        return !vnc_connection_has_error(conn);
d1efb8
+        return FALSE;
d1efb8
 
d1efb8
     switch (etype) {
d1efb8
     case VNC_CONNECTION_ENCODING_RAW:
d1efb8
@@ -3292,7 +3292,7 @@ static gboolean vnc_connection_server_message(VncConnection *conn)
d1efb8
     int ret;
d1efb8
 
d1efb8
     if (vnc_connection_has_error(conn))
d1efb8
-        return !vnc_connection_has_error(conn);
d1efb8
+        return FALSE;
d1efb8
 
d1efb8
     /* NB: make sure that all server message functions
d1efb8
        handle has_error appropriately */
d1efb8
@@ -5838,7 +5838,7 @@ gboolean vnc_connection_set_auth_type(VncConnection *conn, unsigned int type)
d1efb8
     VNC_DEBUG("Thinking about auth type %u", type);
d1efb8
     if (priv->auth_type != VNC_CONNECTION_AUTH_INVALID) {
d1efb8
         vnc_connection_set_error(conn, "%s", "Auth type has already been set");
d1efb8
-        return !vnc_connection_has_error(conn);
d1efb8
+        return FALSE;
d1efb8
     }
d1efb8
     if (type != VNC_CONNECTION_AUTH_NONE &&
d1efb8
         type != VNC_CONNECTION_AUTH_VNC &&
d1efb8
@@ -5851,7 +5851,7 @@ gboolean vnc_connection_set_auth_type(VncConnection *conn, unsigned int type)
d1efb8
         vnc_connection_set_error(conn, "Auth type %u is not supported",
d1efb8
                                  type);
d1efb8
         g_signal_emit(conn, VNC_AUTH_UNSUPPORTED, 0, type);
d1efb8
-        return !vnc_connection_has_error(conn);
d1efb8
+        return FALSE;
d1efb8
     }
d1efb8
     VNC_DEBUG("Decided on auth type %u", type);
d1efb8
     priv->auth_type = type;
d1efb8
@@ -5880,11 +5880,11 @@ gboolean vnc_connection_set_auth_subtype(VncConnection *conn, unsigned int type)
d1efb8
         priv->auth_type != VNC_CONNECTION_AUTH_TLS) {
d1efb8
         vnc_connection_set_error(conn, "Auth type %u does not support subauth",
d1efb8
                                  priv->auth_type);
d1efb8
-        return !vnc_connection_has_error(conn);
d1efb8
+        return FALSE;
d1efb8
     }
d1efb8
     if (priv->auth_subtype != VNC_CONNECTION_AUTH_INVALID) {
d1efb8
         vnc_connection_set_error(conn, "%s", "Auth subtype has already been set");
d1efb8
-        return !vnc_connection_has_error(conn);
d1efb8
+        return FALSE;
d1efb8
     }
d1efb8
     priv->auth_subtype = type;
d1efb8