[PATCH 1/2] server: store errno in wl_client.error

mathias_fiedler at mentor.com mathias_fiedler at mentor.com
Thu Jun 8 07:39:06 UTC 2017


From: Mathias Fiedler <mathias_fiedler at mentor.com>

When an error happens in wl_closure_marshal, wl_closure_send or
wl_closure_queue store the negative errno value in the client's error member.
The errno can be helpful in determining why a client connection has gained
the error state. The negative value distinguishes it from errors detected by
verify_objects or protocol errors reported through wl_resource_post_error.

Signed-off-by: Mathias Fiedler <mathias_fiedler at mentor.com>
---
 src/wayland-server.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/wayland-server.c b/src/wayland-server.c
index 82a3b01..3fa4338 100644
--- a/src/wayland-server.c
+++ b/src/wayland-server.c
@@ -216,12 +216,12 @@ handle_array(struct wl_resource *resource, uint32_t opcode,
 				     &object->interface->events[opcode]);
 
 	if (closure == NULL) {
-		resource->client->error = 1;
+		resource->client->error = -errno;
 		return;
 	}
 
 	if (send_func(closure, resource->client->connection))
-		resource->client->error = 1;
+		resource->client->error = -errno;
 
 	log_closure(resource, closure, true);
 
-- 
1.9.1



More information about the wayland-devel mailing list