Merge branch 't/doc'
[paraslash.git] / compress_filter.c
index 49e386ae775c5c3ace61c08108f1bfede9d7fe85..d7162791b86d372562f690b464779b250519cbeb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005-2012 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2005-2013 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
@@ -41,7 +41,7 @@ static void compress_close(struct filter_node *fn)
        free(fn->private_data);
 }
 
-static void compress_post_select(__a_unused struct sched *s, struct task *t)
+static int compress_post_select(__a_unused struct sched *s, struct task *t)
 {
        struct filter_node *fn = container_of(t, struct filter_node, task);
        struct private_compress_data *pcd = fn->private_data;
@@ -56,12 +56,11 @@ static void compress_post_select(__a_unused struct sched *s, struct task *t)
 
        //inplace = false;
 next_buffer:
-       t->error = 0;
        ret = btr_node_status(btrn, fn->min_iqs, BTR_NT_INTERNAL);
        if (ret < 0)
                goto err;
        if (ret == 0)
-               return;
+               return 0;
        btr_merge(btrn, fn->min_iqs);
        length = btr_next_buffer(btrn, &inbuf) & ~(size_t)1;
        if (length == 0) { /* eof and 1 byte available */
@@ -108,8 +107,8 @@ next_buffer:
        goto next_buffer;
 err:
        assert(ret < 0);
-       t->error = ret;
        btr_remove_node(&fn->btrn);
+       return ret;
 }
 
 /** TODO: Add sanity checks */