From: Andre Noll Date: Sun, 31 Mar 2013 18:17:41 +0000 (+0000) Subject: audioc: Switch to the alternative post select method. X-Git-Tag: v0.4.13~39^2~10 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=88b0ec645a25f8f1a0856bb092fa169d7b0c5f6a;p=paraslash.git audioc: Switch to the alternative post select method. --- diff --git a/audioc.c b/audioc.c index abd76359..3cbd8a82 100644 --- a/audioc.c +++ b/audioc.c @@ -106,7 +106,7 @@ static void audioc_pre_select(struct sched *s, struct task *t) para_fd_set(at->fd, &s->rfds, &s->max_fileno); } -static void audioc_post_select(struct sched *s, struct task *t) +static int audioc_post_select(struct sched *s, struct task *t) { char *buf = NULL; struct audioc_task *at = container_of(t, struct audioc_task, task); @@ -115,7 +115,7 @@ static void audioc_post_select(struct sched *s, struct task *t) if (ret < 0) goto out; if (!FD_ISSET(at->fd, &s->rfds)) - return; + return 0; buf = para_malloc(conf.bufsize_arg); ret = recv_bin_buffer(at->fd, buf, conf.bufsize_arg); PARA_DEBUG_LOG("recv: %d\n", ret); @@ -124,20 +124,21 @@ static void audioc_post_select(struct sched *s, struct task *t) if (ret < 0) goto out; btr_add_output(buf, ret, at->btrn); - return; + return 0; out: if (ret < 0) { free(buf); btr_remove_node(&at->btrn); close(at->fd); } - t->error = ret; + return ret; } static struct audioc_task audioc_task = { .task = { .pre_select = audioc_pre_select, - .post_select = audioc_post_select, + .new_post_select = audioc_post_select, + .post_select = NULL, .status = "audioc task" }, }, *at = &audioc_task;