Wayland: Add strerror output to error descriptions

(cherry picked from commit e0889736fd)
This commit is contained in:
Camilla Löwy 2022-03-24 19:04:58 +01:00
parent 915e43885c
commit f145e1f930

View File

@ -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;
}