aboutsummaryrefslogtreecommitdiff
path: root/backend/session
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-06-15 10:00:57 +0200
committerKenny Levinsen <kl@kl.wtf>2021-06-17 00:28:04 +0200
commit72ee196efaa4e1ecad8a487e9fb273df914fca26 (patch)
tree558d5390b90aefbd327ea25ff7f315d12aec90ce /backend/session
parentfb933d32048de617fdfe5e6567e11f296e20f4fd (diff)
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.
Diffstat (limited to 'backend/session')
-rw-r--r--backend/session/session.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/backend/session/session.c b/backend/session/session.c
index f87de22d..b98f503d 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");