All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dbus: Handle kdbus KDBUS_ITEM_REPLY_TIMEOUT / _DEAD
@ 2016-04-23  1:10 Andrew Zaborowski
  2016-04-23  1:10 ` [PATCH 1/5] gvariant: _gvariant_num_children error check Andrew Zaborowski
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Andrew Zaborowski @ 2016-04-23  1:10 UTC (permalink / raw)
  To: ell

[-- 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


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-04-26  9:08 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-23  1:10 [PATCH] dbus: Handle kdbus KDBUS_ITEM_REPLY_TIMEOUT / _DEAD Andrew Zaborowski
2016-04-23  1:10 ` [PATCH 1/5] gvariant: _gvariant_num_children error check Andrew Zaborowski
2016-04-26  3:59   ` Denis Kenzior
2016-04-23  1:10 ` [PATCH 2/5] gvariant: Allow empty signature in enter_struct_dict_common Andrew Zaborowski
2016-04-26  4:01   ` Denis Kenzior
2016-04-26  9:08     ` Andrzej Zaborowski
2016-04-23  1:10 ` [PATCH 3/5] gvariant: Make sure builder outputs a zero for empty struct Andrew Zaborowski
2016-04-26  4:01   ` Denis Kenzior
2016-04-23  1:10 ` [PATCH 4/5] unit: Gvariant iterator and builder test for empty structs Andrew Zaborowski
2016-04-26  4:01   ` Denis Kenzior
2016-04-23  1:10 ` [PATCH 5/5] unit: Gvariant method call with no arguments tests Andrew Zaborowski
2016-04-26  4:02   ` Denis Kenzior
2016-04-26  3:49 ` [PATCH] dbus: Handle kdbus KDBUS_ITEM_REPLY_TIMEOUT / _DEAD Denis Kenzior

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.