From: Mathias Fiedler <[email protected]>

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 <[email protected]>
---
 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

_______________________________________________
wayland-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to