From f145e1f930b467c7d8ff6cc0771c289f09bad094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Thu, 24 Mar 2022 19:04:58 +0100 Subject: [PATCH] Wayland: Add strerror output to error descriptions (cherry picked from commit e0889736fd603d163d87eef9426e4e4ebc68b60d) --- src/wl_window.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wl_window.c b/src/wl_window.c index 24434fa5..690e69e2 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -1760,9 +1760,9 @@ static void dataSourceHandleSend(void* userData, continue; if (ret == -1) { - // TODO: also report errno maybe. _glfwInputError(GLFW_PLATFORM_ERROR, - "Wayland: Error while writing the clipboard"); + "Wayland: Error while writing the clipboard: %s", + strerror(errno)); close(fd); return; } @@ -1852,9 +1852,9 @@ const char* _glfwPlatformGetClipboardString(void) if (pipe2(fds, O_CLOEXEC) == -1) { - // TODO: also report errno maybe? _glfwInputError(GLFW_PLATFORM_ERROR, - "Wayland: Failed to create clipboard pipe fds"); + "Wayland: Failed to create clipboard pipe: %s", + strerror(errno)); return NULL; } @@ -1895,9 +1895,9 @@ const char* _glfwPlatformGetClipboardString(void) if (errno == EINTR) continue; - // TODO: also report errno maybe. _glfwInputError(GLFW_PLATFORM_ERROR, - "Wayland: Failed to read from clipboard fd"); + "Wayland: Failed to read from clipboard pipe: %s", + strerror(errno)); close(fds[0]); return NULL; }