X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=audioc.c;h=2506c3f8ea6149df47bc84fcb6e5b1b608e70cc5;hb=cdbc8067a2e27ee7f9e0d8ff11cf415603fc0558;hp=76b3d6dba0b3c67742e78903e6352949da4285c4;hpb=fdd8a22e1df57a8c9254e7d0074301e7dde2c557;p=paraslash.git diff --git a/audioc.c b/audioc.c index 76b3d6db..2506c3f8 100644 --- a/audioc.c +++ b/audioc.c @@ -143,17 +143,17 @@ static struct i9e_completer audiod_completers[] = { {.name = NULL} }; -static void audioc_pre_select(struct sched *s, void *context) +static void audioc_pre_monitor(struct sched *s, void *context) { struct audioc_task *at = context; int ret = btr_node_status(at->btrn, 0, BTR_NT_ROOT); if (ret < 0) sched_min_delay(s); - para_fd_set(at->fd, &s->rfds, &s->max_fileno); + sched_monitor_readfd(at->fd, s); } -static int audioc_post_select(struct sched *s, void *context) +static int audioc_post_monitor(struct sched *s, void *context) { char *buf = NULL; struct audioc_task *at = context; @@ -162,7 +162,7 @@ static int audioc_post_select(struct sched *s, void *context) if (ret < 0) goto out; - if (!FD_ISSET(at->fd, &s->rfds)) + if (!sched_read_ok(at->fd, s)) return 0; bufsize = PARA_MAX(1024U, OPT_UINT32_VAL(BUFSIZE)); buf = para_malloc(bufsize); @@ -211,8 +211,8 @@ static int audioc_i9e_line_handler(char *line) EMBRACE(.name = "audioc line handler")); at->task = task_register(&(struct task_info) { .name = "audioc", - .pre_select = audioc_pre_select, - .post_select = audioc_post_select, + .pre_monitor = audioc_pre_monitor, + .post_monitor = audioc_post_monitor, .context = at, }, &sched); i9e_attach_to_stdout(at->btrn); @@ -250,7 +250,7 @@ __noreturn static void interactive_session(void) sigemptyset(&act.sa_mask); act.sa_flags = 0; sigaction(SIGINT, &act, NULL); - sched.select_function = i9e_select; + sched.poll_function = i9e_poll; sched.default_timeout = 1000; ret = i9e_open(&ici, &sched);