Skip to content

Commit

Permalink
[mcetool] Do not silently ignore D-Bus errors from mce. JB#38607
Browse files Browse the repository at this point in the history
While many options in mcetool have no real use for method return messages,
not waiting for a reply also means any errors reported by mce can go
unnoticed.

Wait for reply even when it is not used by upper level logic so that
error replies get handled and printed out.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Jun 2, 2017
1 parent f259567 commit 326f8f6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/mcetool.c
Expand Up @@ -242,10 +242,15 @@ static gboolean xmce_ipc_va(const gchar *const name, DBusMessage **reply,
static gboolean xmce_ipc_no_reply(const gchar *const name,
int arg_type, ...)
{
DBusMessage *reply = 0;

va_list va;
va_start(va, arg_type);
gboolean ack = xmce_ipc_va(name, 0, arg_type, va);
gboolean ack = xmce_ipc_va(name, &reply, arg_type, va);
va_end(va);

if( reply )
dbus_message_unref(reply);
return ack;
}

Expand Down

0 comments on commit 326f8f6

Please sign in to comment.