[PATCH] wayland-client: Set a proper errno

Jasper St. Pierre jstpierre at mecheye.net
Mon Feb 17 14:30:41 PST 2014


errno is supposed to be positive, not negative. It seems that
everything else that calls display_fatal_error() calls it with
a positive error code, so do it here as well.
---
 src/wayland-client.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/wayland-client.c b/src/wayland-client.c
index 0cc9a50..c0d9179 100644
--- a/src/wayland-client.c
+++ b/src/wayland-client.c
@@ -587,13 +587,13 @@ display_handle_error(void *data,
 	switch (code) {
 	case WL_DISPLAY_ERROR_INVALID_OBJECT:
 	case WL_DISPLAY_ERROR_INVALID_METHOD:
-		err = -EINVAL;
+		err = EINVAL;
 		break;
 	case WL_DISPLAY_ERROR_NO_MEMORY:
-		err = -ENOMEM;
+		err = ENOMEM;
 		break;
 	default:
-		err = -EFAULT;
+		err = EFAULT;
 		break;
 	}
 
-- 
1.8.5.3



More information about the wayland-devel mailing list