Doxify error2.c and add GPL header.
[paraslash.git] / compress_filter.c
index 499a9e7674305dde3d7189e73f75fed772a54b04..0c0200e7e3b522af5aad7bb0a9f86f7e32024218 100644 (file)
@@ -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 */
@@ -113,8 +112,8 @@ next_buffer:
        goto next_buffer;
 err:
        assert(ret < 0);
-       t->error = ret;
        btr_remove_node(&fn->btrn);
+       return ret;
 }
 
 /** TODO: Add sanity checks */
@@ -159,8 +158,5 @@ void compress_filter_init(struct filter *f)
        f->post_select = compress_post_select;
        f->parse_config = compress_parse_config;
        f->free_config = compress_free_config;
-       f->help = (struct ggo_help) {
-               .short_help = compress_filter_args_info_help,
-               .detailed_help = compress_filter_args_info_detailed_help
-       };
+       f->help = (struct ggo_help)DEFINE_GGO_HELP(compress_filter);
 }