All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Zaborowski <andrew.zaborowski@intel.com>
To: ell@lists.01.org
Subject: [PATCH 2/2] dbus: Handle kdbus KDBUS_ITEM_REPLY_TIMEOUT / _DEAD
Date: Mon, 18 Apr 2016 16:31:09 +0200	[thread overview]
Message-ID: <1460989877-20113-2-git-send-email-andrew.zaborowski@intel.com> (raw)
In-Reply-To: <1460989877-20113-1-git-send-email-andrew.zaborowski@intel.com>

[-- Attachment #1: Type: text/plain, Size: 1112 bytes --]

Generate DBus1-like error messages on kernel error notifications.
---
 ell/dbus-kernel.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/ell/dbus-kernel.c b/ell/dbus-kernel.c
index b5a07a5..4fd2f29 100644
--- a/ell/dbus-kernel.c
+++ b/ell/dbus-kernel.c
@@ -559,6 +559,7 @@ int _dbus_kernel_recv(int fd, void *kdbus_pool,
 	struct kdbus_item *item;
 	int r;
 	size_t min_size;
+	const char *error;
 
 	memset(&recv_cmd, 0, sizeof(recv_cmd));
 
@@ -601,6 +602,23 @@ int _dbus_kernel_recv(int fd, void *kdbus_pool,
 						user_data);
 			break;
 
+		case KDBUS_ITEM_REPLY_TIMEOUT:
+		case KDBUS_ITEM_REPLY_DEAD:
+			if (item->type == KDBUS_ITEM_REPLY_TIMEOUT)
+				error = "Did not receive a reply.";
+			else
+				error = "Message recipient disconnected from "
+					"message bus without replying.";
+
+			dbus_msg = _dbus_message_new_error(
+					2, msg->cookie_reply, NULL,
+					"org.freedesktop.DBus.Error.NoReply",
+					error);
+			if (dbus_msg)
+				message_func(dbus_msg, user_data);
+
+			break;
+
 		default:
 			break;
 		}
-- 
2.5.0


  reply	other threads:[~2016-04-18 14:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-18 14:31 [PATCH 1/2] dbus: Add private _dbus_message_new_error Andrew Zaborowski
2016-04-18 14:31 ` Andrew Zaborowski [this message]
2016-04-18 14:31 ` [PATCH] dbus: Check message->sealed before get_header_field() Andrew Zaborowski
2016-04-19  2:39   ` Denis Kenzior
2016-04-18 14:31 ` [PATCH] dbus: Don't send replies to messages with no reply flag Andrew Zaborowski
2016-04-18 14:31 ` [PATCH] unit: Add test-dbus-properties --kdbus option Andrew Zaborowski
2016-04-19  2:41   ` Denis Kenzior
2016-04-18 14:31 ` [PATCH 1/5] dbus: Add a Bus Name cache Andrew Zaborowski
2016-04-21  3:30   ` Denis Kenzior
2016-04-18 14:31 ` [PATCH 2/5] dbus: Use the name cache API in _dbus_filter Andrew Zaborowski
2016-04-18 14:31 ` [PATCH 3/5] unit: Update _dbus_filter usage in test-dbus-watch Andrew Zaborowski
2016-04-18 14:31 ` [PATCH 4/5] dbus: Add service watch API based on the name cache Andrew Zaborowski
2016-04-18 14:31 ` [PATCH 5/5] dbus: Use the name cache for public service watches Andrew Zaborowski
2016-04-19  2:37 ` [PATCH 1/2] dbus: Add private _dbus_message_new_error Denis Kenzior
2016-04-22  0:03   ` Andrzej Zaborowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1460989877-20113-2-git-send-email-andrew.zaborowski@intel.com \
    --to=andrew.zaborowski@intel.com \
    --cc=ell@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.