Skip to content

Commit

Permalink
Wayland: Fixed missing error message if creating a custom cursor failed.
Browse files Browse the repository at this point in the history
SDL_GetError() returned no error message because it was written to stderr only.
  • Loading branch information
philippwiesemann committed Mar 28, 2016
1 parent 9011eb1 commit a9edc51
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/video/wayland/SDL_waylandmouse.c
Expand Up @@ -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,
Expand All @@ -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);
Expand Down

0 comments on commit a9edc51

Please sign in to comment.