From: Philip Withnall Date: Thu, 9 Feb 2017 09:40:51 +0000 (+0000) Subject: test: Simplify error checking path in test-service slightly X-Git-Tag: dbus-1.11.10~22 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f88c8a8c398839c2b360e4b4796e1353fa6b6cb6;p=thirdparty%2Fdbus.git test: Simplify error checking path in test-service slightly 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 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99723 Reviewed-by: Simon McVittie --- diff --git a/test/test-service.c b/test/test-service.c index bcfb7342c..b500af314 100644 --- a/test/test-service.c +++ b/test/test-service.c @@ -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)