oss writer: Switch to the alternative post select method.
authorAndre Noll <maan@systemlinux.org>
Sun, 31 Mar 2013 14:01:35 +0000 (14:01 +0000)
committerAndre Noll <maan@systemlinux.org>
Tue, 30 Apr 2013 12:12:46 +0000 (14:12 +0200)
oss_write.c

index 57bdcfa..0b8f1b5 100644 (file)
@@ -157,7 +157,7 @@ err_free:
        return ret;
 }
 
-static void oss_post_select(__a_unused struct sched *s,
+static int oss_post_select(__a_unused struct sched *s,
                struct task *t)
 {
        struct writer_node *wn = container_of(t, struct writer_node, task);
@@ -181,7 +181,7 @@ static void oss_post_select(__a_unused struct sched *s,
                ret = oss_init(wn, rate, ch, format);
                if (ret < 0)
                        goto out;
-               return;
+               return 0;
        }
        btr_merge(btrn, wn->min_iqs);
        bytes = btr_next_buffer(btrn, &data);
@@ -199,9 +199,9 @@ static void oss_post_select(__a_unused struct sched *s,
        btr_consume(btrn, ret);
        ret = 0;
 out:
-       t->error = ret;
        if (ret < 0)
                btr_remove_node(&wn->btrn);
+       return ret;
 }
 
 __malloc static void *oss_parse_config_or_die(int argc, char **argv)
@@ -232,7 +232,8 @@ void oss_write_init(struct writer *w)
        oss_write_cmdline_parser_init(&dummy);
        w->close = oss_close;
        w->pre_select = oss_pre_select;
-       w->post_select = oss_post_select;
+       w->new_post_select = oss_post_select;
+       w->post_select = NULL;
        w->parse_config_or_die = oss_parse_config_or_die;
        w->free_config = oss_free_config;
        w->help = (struct ggo_help) {