From 72ee196efaa4e1ecad8a487e9fb273df914fca26 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 15 Jun 2021 10:00:57 +0200 Subject: [PATCH] backend/session: use DRM_PRIMARY_MINOR_NAME Instead of hardcoding the string "card", use DRM_PRIMARY_MINOR_NAME. Some systems may use another prefix, e.g. OpenBSD uses "drm" instead. --- backend/session/session.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/session/session.c b/backend/session/session.c index f87de22d0..b98f503de 100644 --- a/backend/session/session.c +++ b/backend/session/session.c @@ -127,7 +127,7 @@ static void libseat_session_finish(struct wlr_session *session) { } static bool is_drm_card(const char *sysname) { - const char prefix[] = "card"; + const char prefix[] = DRM_PRIMARY_MINOR_NAME; if (strncmp(sysname, prefix, strlen(prefix)) != 0) { return false; } @@ -395,7 +395,7 @@ static struct udev_enumerate *enumerate_drm_cards(struct udev *udev) { } udev_enumerate_add_match_subsystem(en, "drm"); - udev_enumerate_add_match_sysname(en, "card[0-9]*"); + udev_enumerate_add_match_sysname(en, DRM_PRIMARY_MINOR_NAME "[0-9]*"); if (udev_enumerate_scan_devices(en) != 0) { wlr_log(WLR_ERROR, "udev_enumerate_scan_devices failed");