From 5c699f09cb7cc7bf9d93756f1fa4227ffffe25fe Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 26 Apr 2021 16:27:24 +0200 Subject: Log drmGetDevices2 error code --- backend/headless/backend.c | 4 ++-- backend/wayland/backend.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'backend') diff --git a/backend/headless/backend.c b/backend/headless/backend.c index f0b9e0ce..822024b3 100644 --- a/backend/headless/backend.c +++ b/backend/headless/backend.c @@ -156,7 +156,7 @@ static int open_drm_render_node(void) { uint32_t flags = 0; int devices_len = drmGetDevices2(flags, NULL, 0); if (devices_len < 0) { - wlr_log(WLR_ERROR, "drmGetDevices2 failed"); + wlr_log(WLR_ERROR, "drmGetDevices2 failed: %s", strerror(-devices_len)); return -1; } drmDevice **devices = calloc(devices_len, sizeof(drmDevice *)); @@ -167,7 +167,7 @@ static int open_drm_render_node(void) { devices_len = drmGetDevices2(flags, devices, devices_len); if (devices_len < 0) { free(devices); - wlr_log(WLR_ERROR, "drmGetDevices2 failed"); + wlr_log(WLR_ERROR, "drmGetDevices2 failed: %s", strerror(-devices_len)); return -1; } diff --git a/backend/wayland/backend.c b/backend/wayland/backend.c index 18317e57..1606f0a5 100644 --- a/backend/wayland/backend.c +++ b/backend/wayland/backend.c @@ -118,7 +118,7 @@ static char *get_render_name(const char *name) { uint32_t flags = 0; int devices_len = drmGetDevices2(flags, NULL, 0); if (devices_len < 0) { - wlr_log(WLR_ERROR, "drmGetDevices2 failed"); + wlr_log(WLR_ERROR, "drmGetDevices2 failed: %s", strerror(-devices_len)); return NULL; } drmDevice **devices = calloc(devices_len, sizeof(drmDevice *)); @@ -129,7 +129,7 @@ static char *get_render_name(const char *name) { devices_len = drmGetDevices2(flags, devices, devices_len); if (devices_len < 0) { free(devices); - wlr_log(WLR_ERROR, "drmGetDevices2 failed"); + wlr_log(WLR_ERROR, "drmGetDevices2 failed: %s", strerror(-devices_len)); return NULL; } -- cgit v1.2.3