[Commits] SDL: Wayland: Fixed missing error message if creating a custom c...

libsdl.org revision control commits-owner at libsdl.org
Mon Mar 28 12:10:52 PDT 2016


details:   https://hg.libsdl.org/SDL/rev/eba8155e32b1
changeset: 10130:eba8155e32b1
user:      Philipp Wiesemann <philipp.wiesemann at arcor.de>
date:      Mon Mar 28 21:03:04 2016 +0200
description:
Wayland: Fixed missing error message if creating a custom cursor failed.

SDL_GetError() returned no error message because it was written to stderr only.

diffstat:

 src/video/wayland/SDL_waylandmouse.c |  6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diffs (24 lines):

diff -r b1e3eae293a2 -r eba8155e32b1 src/video/wayland/SDL_waylandmouse.c
--- a/src/video/wayland/SDL_waylandmouse.c	Mon Mar 28 21:02:30 2016 +0200
+++ b/src/video/wayland/SDL_waylandmouse.c	Mon Mar 28 21:03:04 2016 +0200
@@ -116,8 +116,7 @@
     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 @@
                        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);


More information about the commits mailing list