summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2018-02-05 15:39:43 +0100
committerDaniel Stone <daniels@collabora.com>2018-02-09 17:03:28 +0000
commit0fa3474be36be5fee98bebb169df68dcf806e3f3 (patch)
tree19c1cbdeadb3209e0129a91f3c75cda46f5bb054
parentserver: add wl_display_destroy_clients() (diff)
downloadwayland-0fa3474be36be5fee98bebb169df68dcf806e3f3.tar
wayland-0fa3474be36be5fee98bebb169df68dcf806e3f3.tar.gz
wayland-0fa3474be36be5fee98bebb169df68dcf806e3f3.tar.bz2
wayland-0fa3474be36be5fee98bebb169df68dcf806e3f3.tar.lz
wayland-0fa3474be36be5fee98bebb169df68dcf806e3f3.tar.xz
wayland-0fa3474be36be5fee98bebb169df68dcf806e3f3.tar.zst
wayland-0fa3474be36be5fee98bebb169df68dcf806e3f3.zip
shm: provide actual error on mmap failed
When an mmap() fails, a WL_SHM_ERROR_INVALID_FD is raised and the client is killed. However, there is no indication of the actual system error that caused mmap() to fail, which makes such error harder to investigate. Provide the actual error message that caused mmap() to fail. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Jonas Ã…dahl <jadahl@gmail.com>
-rw-r--r--src/wayland-shm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wayland-shm.c b/src/wayland-shm.c
index 8e2ef77..4191231 100644
--- a/src/wayland-shm.c
+++ b/src/wayland-shm.c
@@ -281,7 +281,7 @@ shm_create_pool(struct wl_client *client, struct wl_resource *resource,
if (pool->data == MAP_FAILED) {
wl_resource_post_error(resource,
WL_SHM_ERROR_INVALID_FD,
- "failed mmap fd %d", fd);
+ "failed mmap fd %d: %m", fd);
goto err_free;
}
close(fd);