summaryrefslogtreecommitdiffstats
path: root/ui/twin/pbt-scr.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-04-10 12:19:13 +1000
committerGeoff Levand <geoff@infradead.org>2013-04-10 10:49:20 -0700
commit37428306a270088bfcb1f94362a0fe5b7a5a888e (patch)
tree5d1aeca3eca44b68a8f8939e3bea44709a953aa9 /ui/twin/pbt-scr.c
parentee86a0bd989511319adf3467b41b5b2e1f486aa6 (diff)
downloadtalos-petitboot-37428306a270088bfcb1f94362a0fe5b7a5a888e.tar.gz
talos-petitboot-37428306a270088bfcb1f94362a0fe5b7a5a888e.zip
waiter: Don't rely on global variables to keep waiter state
Rather than defining the set of waiters (and pollfds) in waiter.c, add a struct waitset to contain these. A waitset is created with waitset_create, which is passed to the waiter_* functions. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
Diffstat (limited to 'ui/twin/pbt-scr.c')
-rw-r--r--ui/twin/pbt-scr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ui/twin/pbt-scr.c b/ui/twin/pbt-scr.c
index 3a5a70b..8532bc1 100644
--- a/ui/twin/pbt-scr.c
+++ b/ui/twin/pbt-scr.c
@@ -368,7 +368,9 @@ static void pbt_scr_destructor(struct pbt_scr *scr)
memset(scr, 0, sizeof(*scr));
}
-struct pbt_scr *pbt_scr_init(void *talloc_ctx, enum pbt_twin_backend backend,
+struct pbt_scr *pbt_scr_init(void *talloc_ctx,
+ struct waitset *waitset,
+ enum pbt_twin_backend backend,
unsigned int width, unsigned int height,
const char *filename_background,
twin_bool_t (*scr_event_cb)(twin_screen_t *tscreen,
@@ -441,7 +443,7 @@ struct pbt_scr *pbt_scr_init(void *talloc_ctx, enum pbt_twin_backend backend,
assert(waiter_fd != -1);
- waiter_register(waiter_fd, WAIT_IN, (void *)pbt_twin_waiter_cb,
+ waiter_register(waitset, waiter_fd, WAIT_IN, (void *)pbt_twin_waiter_cb,
&scr->twin_ctx);
return scr;
OpenPOWER on IntegriCloud