]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - write.c
Merge branch 'sched'
[paraslash.git] / write.c
diff --git a/write.c b/write.c
index b692ac5080af8dfee4efd79a95048e6c8ad6999d..e42062038dc6d1054c80e84c2d3dd998b359bce9 100644 (file)
--- a/write.c
+++ b/write.c
@@ -57,7 +57,7 @@ static struct writer_node_group *wng;
  * \return If not, return -E_NO_WAV_HEADER, otherwise, return zero. If
  * there is less than WAV_HEADER_LEN bytes awailable, return one.
  */
-static void check_wav_pre_select(struct sched *s, struct task *t)
+static void check_wav_pre_select(__a_unused struct sched *s, struct task *t)
 {
        struct check_wav_task *cwt = t->private_data;
        unsigned char *a;
@@ -161,6 +161,17 @@ out:
        return NULL;
 }
 
+static void wng_event_handler(struct task *t)
+{
+       struct writer_node_group *g = t->private_data;
+
+       PARA_INFO_LOG("%s\n", PARA_STRERROR(-t->ret));
+       unregister_task(t);
+       wng_close(g);
+       wng_destroy(g);
+}
+
+
 static void idt_event_handler(struct task *t)
 {
        int ret;
@@ -170,6 +181,7 @@ static void idt_event_handler(struct task *t)
        wng->buf = sit.buf;
        wng->loaded = &sit.loaded;
        wng->input_eof = &sit.eof;
+       wng->task.event_handler = wng_event_handler;
        ret = wng_open(wng);
        if (ret < 0) {
                PARA_ERROR_LOG("%s\n", PARA_STRERROR(-ret));