Make writers remove btr node on errors.
authorAndre Noll <maan@systemlinux.org>
Wed, 13 Jan 2010 20:44:35 +0000 (21:44 +0100)
committerAndre Noll <maan@systemlinux.org>
Wed, 13 Jan 2010 20:44:35 +0000 (21:44 +0100)
This is what receivers/filters do as well.

alsa_write.c
file_write.c
oss_write.c

index 11fc58a..75fe6fa 100644 (file)
@@ -364,6 +364,7 @@ again:
        ret = -E_ALSA_WRITE;
 err:
        assert(ret < 0);
+       btr_remove_node(btrn);
        t->error = ret;
 }
 
index 7a24b3a..f721430 100644 (file)
@@ -167,6 +167,7 @@ static void file_write_post_select_btr(__a_unused struct sched *s,
 err:
        assert(ret < 0);
        t->error = ret;
+       btr_remove_node(btrn);
 }
 
 __malloc static void *file_write_parse_config(const char *options)
index 4e5f9b5..c1717eb 100644 (file)
@@ -249,6 +249,8 @@ static void oss_post_select_btr(__a_unused struct sched *s,
        ret = 0;
 out:
        t->error = ret;
+       if (ret < 0)
+               btr_remove_node(btrn);
 }
 
 static int oss_open(struct writer_node *wn)