From a9edc5137eaa5e2f82dac465aeb893154d20b9b7 Mon Sep 17 00:00:00 2001 From: Philipp Wiesemann Date: Mon, 28 Mar 2016 21:03:04 +0200 Subject: [PATCH] Wayland: Fixed missing error message if creating a custom cursor failed. SDL_GetError() returned no error message because it was written to stderr only. --- src/video/wayland/SDL_waylandmouse.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/video/wayland/SDL_waylandmouse.c b/src/video/wayland/SDL_waylandmouse.c index 8a8332cc5..417f151ca 100644 --- a/src/video/wayland/SDL_waylandmouse.c +++ b/src/video/wayland/SDL_waylandmouse.c @@ -116,8 +116,7 @@ create_buffer_from_shm(Wayland_CursorData *d, shm_fd = wayland_create_tmp_file(size); if (shm_fd < 0) { - fprintf(stderr, "creating mouse cursor buffer failed!\n"); - return -1; + return SDL_SetError("Creating mouse cursor buffer failed."); } d->shm_data = mmap(NULL, @@ -128,9 +127,8 @@ create_buffer_from_shm(Wayland_CursorData *d, 0); if (d->shm_data == MAP_FAILED) { d->shm_data = NULL; - fprintf (stderr, "mmap () failed\n"); close (shm_fd); - return -1; + return SDL_SetError("mmap() failed."); } shm_pool = wl_shm_create_pool(data->shm, shm_fd, size);