Skip to content

stuff/dbus-example /dbus-example.c - dbus_message_iter_append_basic error in the reply_to_method_call #17

@bucefal76

Description

@bucefal76

Please change the local variable bool type to dbus_bool_t in this function:

void reply_to_method_call(DBusMessage* msg, DBusConnection* conn)
{
DBusMessage* reply;
DBusMessageIter args;
bool stat = true;

If not some DBus library will return error:

dbus[466974]: arguments to dbus_message_iter_append_basic() were incorrect, assertion "*bool_p == 0 || *bool_p == 1" failed in file ../../../dist/dbus/dbus-message.c line 2777.
This is normally a bug in some application using the D-Bus library.

Fixed code shall looks like:

void reply_to_method_call(DBusMessage* msg, DBusConnection* conn)
{
DBusMessage* reply;
DBusMessageIter args;
dbus_bool_t stat = true;

I had found this issue running D-Bus for QNX ...

Ps. Thank you much for D-Bus example, works fine with this fix ... 👍

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions