X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=filter.c;h=38122977f4bad9f0982fe30594e4f36c50c64176;hp=0dfc94b1cc7213e024f6bc626c48be79cb09df75;hb=c25d04743aad0482a51fe287597434a3bf6f1108;hpb=32e646780461f96682d1191d31e08e4602ab125e diff --git a/filter.c b/filter.c index 0dfc94b1..38122977 100644 --- a/filter.c +++ b/filter.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2011 Andre Noll + * Copyright (C) 2005-2012 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -7,7 +7,6 @@ /** \file filter.c The stand-alone filter program. */ #include -#include #include "para.h" #include "filter.cmdline.h" @@ -120,7 +119,7 @@ int main(int argc, char *argv[]) sit->btrn = btr_new_node(&(struct btr_node_description) EMBRACE(.name = "stdin")); stdin_set_defaults(sit); - register_task(&sit->task); + register_task(&s, &sit->task); fns = para_malloc(conf.filter_given * sizeof(*fns)); for (i = 0, parent = sit->btrn; i < conf.filter_given; i++) { @@ -143,13 +142,13 @@ int main(int argc, char *argv[]) fn->task.pre_select = f->pre_select; fn->task.post_select = f->post_select; f->open(fn); - register_task(&fn->task); + register_task(&s, &fn->task); parent = fn->btrn; } sot->btrn = btr_new_node(&(struct btr_node_description) EMBRACE(.name = "stdout", .parent = parent)); stdout_set_defaults(sot); - register_task(&sot->task); + register_task(&s, &sot->task); s.default_timeout.tv_sec = 1; s.default_timeout.tv_usec = 0; @@ -162,13 +161,14 @@ out_cleanup: f = filters + fn->filter_num; if (f->close) f->close(fn); - btr_free_node(fn->btrn); - free(fn->conf); + btr_remove_node(&fn->btrn); + if (f->free_config) + f->free_config(fn->conf); free(fn); } free(fns); - btr_free_node(sit->btrn); - btr_free_node(sot->btrn); + btr_remove_node(&sit->btrn); + btr_remove_node(&sot->btrn); out: if (ret < 0) PARA_EMERG_LOG("%s\n", para_strerror(-ret));