# HG changeset patch # User Michael Albinus # Date 1217615710 0 # Node ID 194ecdbbd8a369185857cf20af0f94c845f78537 # Parent 50d4090b5c35959f068ced697c4e9e7c08db2907 * dbusbind.c (xd_read_message): Handle D-Bus error messages. diff -r 50d4090b5c35 -r 194ecdbbd8a3 src/dbusbind.c --- a/src/dbusbind.c Fri Aug 01 18:05:37 2008 +0000 +++ b/src/dbusbind.c Fri Aug 01 18:35:10 2008 +0000 @@ -1436,29 +1436,32 @@ /* Read message type, message serial, unique name, object path, interface and member from the message. */ - mtype = dbus_message_get_type (dmessage); - serial = (mtype == DBUS_MESSAGE_TYPE_METHOD_RETURN ? - dbus_message_get_reply_serial (dmessage) : - dbus_message_get_serial (dmessage)); - uname = dbus_message_get_sender (dmessage); - path = dbus_message_get_path (dmessage); + mtype = dbus_message_get_type (dmessage); + serial = + ((mtype == DBUS_MESSAGE_TYPE_METHOD_RETURN) + || (mtype == DBUS_MESSAGE_TYPE_ERROR)) + ? dbus_message_get_reply_serial (dmessage) + : dbus_message_get_serial (dmessage); + uname = dbus_message_get_sender (dmessage); + path = dbus_message_get_path (dmessage); interface = dbus_message_get_interface (dmessage); - member = dbus_message_get_member (dmessage); + member = dbus_message_get_member (dmessage); XD_DEBUG_MESSAGE ("Event received: %s %d %s %s %s %s %s", - (mtype == DBUS_MESSAGE_TYPE_INVALID) ? - "DBUS_MESSAGE_TYPE_INVALID" : - (mtype == DBUS_MESSAGE_TYPE_METHOD_CALL) ? - "DBUS_MESSAGE_TYPE_METHOD_CALL" : - (mtype == DBUS_MESSAGE_TYPE_METHOD_RETURN) ? - "DBUS_MESSAGE_TYPE_METHOD_RETURN" : - (mtype == DBUS_MESSAGE_TYPE_ERROR) ? - "DBUS_MESSAGE_TYPE_METHOD_ERROR" : - "DBUS_MESSAGE_TYPE_METHOD_SIGNAL", + (mtype == DBUS_MESSAGE_TYPE_INVALID) + ? "DBUS_MESSAGE_TYPE_INVALID" + : (mtype == DBUS_MESSAGE_TYPE_METHOD_CALL) + ? "DBUS_MESSAGE_TYPE_METHOD_CALL" + : (mtype == DBUS_MESSAGE_TYPE_METHOD_RETURN) + ? "DBUS_MESSAGE_TYPE_METHOD_RETURN" + : (mtype == DBUS_MESSAGE_TYPE_ERROR) + ? "DBUS_MESSAGE_TYPE_ERROR" + : "DBUS_MESSAGE_TYPE_SIGNAL", serial, uname, path, interface, member, SDATA (format2 ("%s", args, Qnil))); - if (mtype == DBUS_MESSAGE_TYPE_METHOD_RETURN) + if ((mtype == DBUS_MESSAGE_TYPE_METHOD_RETURN) + || (mtype == DBUS_MESSAGE_TYPE_ERROR)) { /* Search for a registered function of the message. */ key = list2 (bus, make_number (serial));