]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
test: Simplify error checking path in test-service slightly
authorPhilip Withnall <withnall@endlessm.com>
Thu, 9 Feb 2017 09:40:51 +0000 (09:40 +0000)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Mon, 13 Feb 2017 16:03:05 +0000 (16:03 +0000)
This should shut up Coverity from complaining about not checking the
return value of dbus_set_error_from_message(), which is equivalent to
the (type == DBUS_MESSAGE_TYPE_ERROR) check.

Coverity ID: 54697
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99723
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
test/test-service.c

index bcfb7342c809541b76e466d4022053f6fd5f6284..b500af31441188aea136e7f25f3c9893d8c2bfef 100644 (file)
@@ -92,9 +92,8 @@ check_hello_from_self_reply (DBusPendingCall *pcall,
       
       dbus_message_unref (echo_reply);
     }
-  else if (type == DBUS_MESSAGE_TYPE_ERROR)
+  else if (dbus_set_error_from_message (&error, reply))
     {
-      dbus_set_error_from_message (&error, reply);
       printf ("Error type in reply: %s\n", error.message);
 
       if (strcmp (error.name, DBUS_ERROR_NO_MEMORY) != 0)