aboutsummaryrefslogtreecommitdiff
path: root/libseat/backend
diff options
context:
space:
mode:
authorKenny Levinsen <kl@kl.wtf>2020-08-30 00:05:19 +0200
committerKenny Levinsen <kl@kl.wtf>2020-08-30 00:05:19 +0200
commitc36cc962e6b3fd7bec8093756d4c3a7df9940862 (patch)
tree43afee6a471cc3366be43d434fcf7397baf0180e /libseat/backend
parent5470c481134ab194f32f53fd8d5ba7c916478f74 (diff)
linked_list: Implement linked_list_take
Diffstat (limited to 'libseat/backend')
-rw-r--r--libseat/backend/seatd.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/libseat/backend/seatd.c b/libseat/backend/seatd.c
index afeab7f..1a187b1 100644
--- a/libseat/backend/seatd.c
+++ b/libseat/backend/seatd.c
@@ -204,14 +204,8 @@ static int queue_event(struct backend_seatd *backend, int opcode) {
}
static void execute_events(struct backend_seatd *backend) {
- struct linked_list list = {
- .next = backend->pending_events.next,
- .prev = backend->pending_events.prev,
- };
- list.next->prev = &list;
- list.prev->next = &list;
-
- linked_list_init(&backend->pending_events);
+ struct linked_list list;
+ linked_list_take(&list, &backend->pending_events);
while (!linked_list_empty(&list)) {
struct pending_event *ev = (struct pending_event *)list.next;
int opcode = ev->opcode;