From b42f4ac28861788e5ff46452b87a8a33c4969279 Mon Sep 17 00:00:00 2001 From: Luflosi Date: Mon, 4 Nov 2019 23:59:18 +0100 Subject: [PATCH] Restore proper error reporting functionality In 841c907efc643a4f4f06b2686d0d1e6022710600, the `%m` format specifier was replaced by `%%m`, which just prints `%m`. To keep the functionality of `%m` without using `%m`, the error string can be printed manually. --- glfw/wl_window.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/glfw/wl_window.c b/glfw/wl_window.c index 8fcbc1431..73261a9f9 100644 --- a/glfw/wl_window.c +++ b/glfw/wl_window.c @@ -242,8 +242,8 @@ static struct wl_buffer* createShmBuffer(const GLFWimage* image) if (fd < 0) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Wayland: Creating a buffer file for %d B failed: %%m", - length); + "Wayland: Creating a buffer file for %d B failed: %s", + length, strerror(errno)); return NULL; } @@ -251,7 +251,7 @@ static struct wl_buffer* createShmBuffer(const GLFWimage* image) if (data == MAP_FAILED) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Wayland: mmap failed: %%m"); + "Wayland: mmap failed: %s", strerror(errno)); close(fd); return NULL; }