From: Michael Albinus Date: Fri, 1 Aug 2008 18:35:49 +0000 (+0000) Subject: * dbusbind.c (xd_read_message): Handle D-Bus error messages. X-Git-Tag: emacs-pretest-23.0.90~3707 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=367ea1732aaf87414718e7e1ed23916956f0fa4c;p=emacs.git * dbusbind.c (xd_read_message): Handle D-Bus error messages. --- diff --git a/src/ChangeLog b/src/ChangeLog index a0707ab86b0..f45a5f19741 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2008-08-01 Michael Albinus + + * dbusbind.c (xd_read_message): Handle D-Bus error messages. + 2008-08-01 Adrian Robert * nsterm.h (NSInteger, NSUInteger): Add defines for non-Leopard. diff --git a/src/dbusbind.c b/src/dbusbind.c index 21e3f83a509..c0c2a8bd719 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -1436,29 +1436,32 @@ xd_read_message (bus) /* 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));