mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-22 06:47:12 -04:00
backend/session: save devnode in wlr_device
This commit is contained in:
parent
1e7867610c
commit
81550bc6d2
2 changed files with 8 additions and 0 deletions
|
|
@ -210,6 +210,12 @@ struct wlr_device *wlr_session_open_file(struct wlr_session *session,
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dev->devnode = strdup(path);
|
||||||
|
if (!dev->devnode) {
|
||||||
|
wlr_log_errno(WLR_ERROR, "Allocation failed");
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
dev->fd = fd;
|
dev->fd = fd;
|
||||||
dev->dev = st.st_rdev;
|
dev->dev = st.st_rdev;
|
||||||
dev->device_id = device_id;
|
dev->device_id = device_id;
|
||||||
|
|
@ -233,6 +239,7 @@ void wlr_session_close_file(struct wlr_session *session,
|
||||||
}
|
}
|
||||||
close(dev->fd);
|
close(dev->fd);
|
||||||
wl_list_remove(&dev->link);
|
wl_list_remove(&dev->link);
|
||||||
|
free(dev->devnode);
|
||||||
free(dev);
|
free(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ struct wlr_device {
|
||||||
int fd;
|
int fd;
|
||||||
int device_id;
|
int device_id;
|
||||||
dev_t dev;
|
dev_t dev;
|
||||||
|
char *devnode;
|
||||||
struct wl_list link;
|
struct wl_list link;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue