module: remove module_run_context

Store abort_fd directly in the module struct instead. This then allows
us to pass the module pointer as-is to the modules' run functions.
This commit is contained in:
Daniel Eklöf 2019-01-13 15:34:59 +01:00
parent acdeff3b6e
commit 76d135e257
13 changed files with 57 additions and 77 deletions

View file

@ -51,9 +51,9 @@ content(struct module *mod)
}
static int
run(struct module_run_context *ctx)
run(struct module *mod)
{
const struct bar *bar = ctx->module->bar;
const struct bar *bar = mod->bar;
bar->refresh(bar);
while (true) {
@ -65,7 +65,7 @@ run(struct module_run_context *ctx)
time_t timeout = next_min - now;
assert(timeout >= 0 && timeout <= 60);
struct pollfd fds[] = {{.fd = ctx->abort_fd, .events = POLLIN}};
struct pollfd fds[] = {{.fd = mod->abort_fd, .events = POLLIN}};
poll(fds, 1, timeout * 1000);
if (fds[0].revents & POLLIN)